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
06596629
Commit
06596629
authored
Dec 23, 2013
by
Baranovskiy Konstantin
Committed by
Wayne Stambaugh
Dec 23, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix worksheet multiple line text plotting bug. (fixes lp:1261906)
parent
860d26e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
10 deletions
+51
-10
common_plot_functions.cpp
common/common_plot_functions.cpp
+2
-1
drawtxt.cpp
common/drawtxt.cpp
+47
-8
plot_common.h
include/plot_common.h
+2
-1
No files found.
common/common_plot_functions.cpp
View file @
06596629
...
@@ -133,7 +133,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
...
@@ -133,7 +133,8 @@ void PlotWorkSheet( PLOTTER* plotter, const TITLE_BLOCK& aTitleBlock,
text
->
GetSize
(),
text
->
GetSize
(),
text
->
GetHorizJustify
(),
text
->
GetVertJustify
(),
text
->
GetHorizJustify
(),
text
->
GetVertJustify
(),
text
->
GetPenWidth
(),
text
->
GetPenWidth
(),
text
->
IsItalic
(),
text
->
IsBold
()
);
text
->
IsItalic
(),
text
->
IsBold
(),
text
->
IsMultilineAllowed
()
);
}
}
break
;
break
;
...
...
common/drawtxt.cpp
View file @
06596629
...
@@ -602,6 +602,7 @@ void DrawGraphicHaloText( EDA_RECT* aClipBox, wxDC * aDC,
...
@@ -602,6 +602,7 @@ void DrawGraphicHaloText( EDA_RECT* aClipBox, wxDC * aDC,
* Use a value min(aSize.x, aSize.y) / 5 for a bold text
* Use a value min(aSize.x, aSize.y) / 5 for a bold text
* @param aItalic = true to simulate an italic font
* @param aItalic = true to simulate an italic font
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
* @param aBold = true to use a bold font Useful only with default width value (aWidth = 0)
* @param aMultilineAllowed = true to plot text as multiline, otherwise single line
*/
*/
void
PLOTTER
::
Text
(
const
wxPoint
&
aPos
,
void
PLOTTER
::
Text
(
const
wxPoint
&
aPos
,
enum
EDA_COLOR_T
aColor
,
enum
EDA_COLOR_T
aColor
,
...
@@ -612,7 +613,8 @@ void PLOTTER::Text( const wxPoint& aPos,
...
@@ -612,7 +613,8 @@ void PLOTTER::Text( const wxPoint& aPos,
enum
EDA_TEXT_VJUSTIFY_T
aV_justify
,
enum
EDA_TEXT_VJUSTIFY_T
aV_justify
,
int
aWidth
,
int
aWidth
,
bool
aItalic
,
bool
aItalic
,
bool
aBold
)
bool
aBold
,
bool
aMultilineAllowed
)
{
{
int
textPensize
=
aWidth
;
int
textPensize
=
aWidth
;
...
@@ -630,13 +632,50 @@ void PLOTTER::Text( const wxPoint& aPos,
...
@@ -630,13 +632,50 @@ void PLOTTER::Text( const wxPoint& aPos,
if
(
aColor
>=
0
)
if
(
aColor
>=
0
)
SetColor
(
aColor
);
SetColor
(
aColor
);
DrawGraphicText
(
NULL
,
NULL
,
aPos
,
aColor
,
aText
,
if
(
aMultilineAllowed
)
aOrient
,
aSize
,
{
aH_justify
,
aV_justify
,
// EDA_TEXT needs for calculations of the position of every
textPensize
,
aItalic
,
// line according to orientation and justifications
aBold
,
EDA_TEXT
*
multilineText
=
new
EDA_TEXT
(
aText
);
NULL
,
multilineText
->
SetSize
(
aSize
);
this
);
multilineText
->
SetTextPosition
(
aPos
);
multilineText
->
SetOrientation
(
aOrient
);
multilineText
->
SetHorizJustify
(
aH_justify
);
multilineText
->
SetVertJustify
(
aV_justify
);
multilineText
->
SetThickness
(
aWidth
);
multilineText
->
SetMultilineAllowed
(
aMultilineAllowed
);
std
::
vector
<
wxPoint
>
positions
;
wxArrayString
*
list
=
wxStringSplit
(
aText
,
'\n'
);
positions
.
reserve
(
list
->
Count
()
);
multilineText
->
GetPositionsOfLinesOfMultilineText
(
positions
,
list
->
Count
()
);
for
(
unsigned
ii
=
0
;
ii
<
list
->
Count
();
ii
++
)
{
wxString
&
txt
=
list
->
Item
(
ii
);
DrawGraphicText
(
NULL
,
NULL
,
positions
[
ii
],
aColor
,
txt
,
aOrient
,
aSize
,
aH_justify
,
aV_justify
,
textPensize
,
aItalic
,
aBold
,
NULL
,
this
);
}
delete
multilineText
;
delete
list
;
}
else
{
DrawGraphicText
(
NULL
,
NULL
,
aPos
,
aColor
,
aText
,
aOrient
,
aSize
,
aH_justify
,
aV_justify
,
textPensize
,
aItalic
,
aBold
,
NULL
,
this
);
}
if
(
aWidth
!=
textPensize
)
if
(
aWidth
!=
textPensize
)
SetCurrentLineWidth
(
aWidth
);
SetCurrentLineWidth
(
aWidth
);
...
...
include/plot_common.h
View file @
06596629
...
@@ -253,7 +253,8 @@ public:
...
@@ -253,7 +253,8 @@ public:
enum
EDA_TEXT_VJUSTIFY_T
aV_justify
,
enum
EDA_TEXT_VJUSTIFY_T
aV_justify
,
int
aWidth
,
int
aWidth
,
bool
aItalic
,
bool
aItalic
,
bool
aBold
);
bool
aBold
,
bool
aMultilineAllowed
=
false
);
/**
/**
* Draw a marker (used for the drill map)
* Draw a marker (used for the drill map)
...
...
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