Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ee3b9500
Commit
ee3b9500
authored
Jan 30, 2009
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added: comments in Drawtxt.cpp. By the way, solved: bug when drawing a 3D board with pcb texts.
parent
37c6e40d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
drawtxt.cpp
common/drawtxt.cpp
+10
-8
drawtxt.h
include/drawtxt.h
+3
-2
No files found.
common/drawtxt.cpp
View file @
ee3b9500
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
/****************************************************************************************************/
/****************************************************************************************************/
void
DrawGraphicText
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
DC
,
void
DrawGraphicText
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
a
DC
,
const
wxPoint
&
aPos
,
EDA_Colors
aColor
,
const
wxString
&
aText
,
const
wxPoint
&
aPos
,
EDA_Colors
aColor
,
const
wxString
&
aText
,
int
aOrient
,
const
wxSize
&
aSize
,
int
aOrient
,
const
wxSize
&
aSize
,
enum
GRTextHorizJustifyType
aH_justify
,
enum
GRTextHorizJustifyType
aH_justify
,
...
@@ -34,7 +34,8 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
...
@@ -34,7 +34,8 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
/** Function DrawGraphicText
/** Function DrawGraphicText
* Draw a graphic text (like module texts)
* Draw a graphic text (like module texts)
* Draw a graphic text (like module texts)
* Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
* @param aPos = text position (according to h_justify, v_justify)
* @param aPos = text position (according to h_justify, v_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aText = text to draw
...
@@ -46,7 +47,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
...
@@ -46,7 +47,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
* if width < 0 : draw segments in sketch mode, width = abs(width)
* if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font
* @param aItalic = true to simulate an italic font
* @param aCallback() = function called (if non null) to draw each segment.
* @param aCallback() = function called (if non null) to draw each segment.
* used
only to draw 3D text
s
* used
to draw 3D texts or for plotting, NULL for normal drawing
s
*/
*/
{
{
int
ii
,
kk
,
char_count
,
AsciiCode
,
endcar
;
int
ii
,
kk
,
char_count
,
AsciiCode
,
endcar
;
...
@@ -189,10 +190,11 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
...
@@ -189,10 +190,11 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
ox
=
cX
-
dx
;
ox
=
cX
-
dx
;
oy
=
cY
+
dy
;
oy
=
cY
+
dy
;
if
(
aPanel
->
GetScreen
()
->
Scale
(
aSize
.
x
)
==
0
)
// Note: if aPanel == NULL, we are using a GL Canvas that handle scaling
if
(
aPanel
&&
aPanel
->
GetScreen
()
->
Scale
(
aSize
.
x
)
==
0
)
return
;
return
;
if
(
ABS
(
(
aPanel
->
GetScreen
()
->
Scale
(
aSize
.
x
)
)
)
<
3
)
/* shapes are too small: connot be drawn */
if
(
aPanel
&&
ABS
(
(
aPanel
->
GetScreen
()
->
Scale
(
aSize
.
x
)
)
)
<
3
)
/* shapes are too small: connot be drawn */
{
/* insteed the text is drawn as a line */
{
/* insteed the text is drawn as a line */
dx
=
(
pitch
*
char_count
)
/
2
;
dx
=
(
pitch
*
char_count
)
/
2
;
dy
=
size_v
/
2
;
/* line is always centered */
dy
=
size_v
/
2
;
/* line is always centered */
...
@@ -209,7 +211,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
...
@@ -209,7 +211,7 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
if
(
aCallback
)
if
(
aCallback
)
aCallback
(
ux0
,
uy0
,
dx
,
dy
);
aCallback
(
ux0
,
uy0
,
dx
,
dy
);
else
else
GRLine
(
&
aPanel
->
m_ClipBox
,
DC
,
ux0
,
uy0
,
dx
,
dy
,
aWidth
,
aColor
);
GRLine
(
&
aPanel
->
m_ClipBox
,
a
DC
,
ux0
,
uy0
,
dx
,
dy
,
aWidth
,
aColor
);
return
;
return
;
}
}
...
@@ -259,11 +261,11 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
...
@@ -259,11 +261,11 @@ void DrawGraphicText( WinEDA_DrawPanel* aPanel, wxDC* DC,
int
ik
,
*
coordptr
;
int
ik
,
*
coordptr
;
coordptr
=
coord
;
coordptr
=
coord
;
for
(
ik
=
0
;
ik
<
(
ii
-
2
);
ik
+=
2
,
coordptr
+=
2
)
for
(
ik
=
0
;
ik
<
(
ii
-
2
);
ik
+=
2
,
coordptr
+=
2
)
GRCSegm
(
&
aPanel
->
m_ClipBox
,
DC
,
*
coordptr
,
*
(
coordptr
+
1
),
GRCSegm
(
&
aPanel
->
m_ClipBox
,
a
DC
,
*
coordptr
,
*
(
coordptr
+
1
),
*
(
coordptr
+
2
),
*
(
coordptr
+
3
),
aWidth
,
aColor
);
*
(
coordptr
+
2
),
*
(
coordptr
+
3
),
aWidth
,
aColor
);
}
}
else
else
GRPoly
(
&
aPanel
->
m_ClipBox
,
DC
,
ii
/
2
,
(
wxPoint
*
)
coord
,
0
,
GRPoly
(
&
aPanel
->
m_ClipBox
,
a
DC
,
ii
/
2
,
(
wxPoint
*
)
coord
,
0
,
aWidth
,
aColor
,
aColor
);
aWidth
,
aColor
,
aColor
);
}
}
plume
=
f_cod
;
ii
=
0
;
plume
=
f_cod
;
ii
=
0
;
...
...
include/drawtxt.h
View file @
ee3b9500
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
/** Function DrawGraphicText
/** Function DrawGraphicText
* Draw a graphic text (like module texts)
* Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel
* @param aPanel = the current DrawPanel. NULL if draw within a 3D GL Canvas
* @param aDC = the current Device Context. NULL if draw within a 3D GL Canvas
* @param aPos = text position (according to h_justify, v_justify)
* @param aPos = text position (according to h_justify, v_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aText = text to draw
...
@@ -23,7 +24,7 @@
...
@@ -23,7 +24,7 @@
* if width < 0 : draw segments in sketch mode, width = abs(width)
* if width < 0 : draw segments in sketch mode, width = abs(width)
* @param aItalic = true to simulate an italic font
* @param aItalic = true to simulate an italic font
* @param aCallback() = function called (if non null) to draw each segment.
* @param aCallback() = function called (if non null) to draw each segment.
* used
only to draw 3D text
s
* used
to draw 3D texts or for plotting, NULL for normal drawing
s
*/
*/
void
DrawGraphicText
(
WinEDA_DrawPanel
*
aPanel
,
void
DrawGraphicText
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
wxDC
*
aDC
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment