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
7d58d826
Commit
7d58d826
authored
Dec 08, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common/gal/stroke_font.cpp was segfaulting in wx 2.8 when drawing multi-line string.
parent
e2b7ba4b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
stroke_font.cpp
common/gal/stroke_font.cpp
+5
-4
No files found.
common/gal/stroke_font.cpp
View file @
7d58d826
...
...
@@ -186,17 +186,18 @@ void STROKE_FONT::Draw( const wxString& aText, const VECTOR2D& aPosition, double
m_gal
->
SetLineWidth
(
m_gal
->
GetLineWidth
()
*
BOLD_FACTOR
);
// Split multiline strings into separate ones and draw them line by line
int
begin
=
0
;
int
newlinePos
=
aText
.
F
ind
(
'\n'
);
size_t
begin
=
0
;
size_t
newlinePos
=
aText
.
f
ind
(
'\n'
);
while
(
newlinePos
!=
wxNOT_FOUND
)
while
(
newlinePos
!=
aText
.
npos
)
{
size_t
length
=
newlinePos
-
begin
;
drawSingleLineText
(
aText
.
Mid
(
begin
,
length
)
);
m_gal
->
Translate
(
VECTOR2D
(
0.0
,
lineHeight
)
);
begin
=
newlinePos
+
1
;
newlinePos
=
aText
.
find
(
'\n'
,
begin
+
1
);
newlinePos
=
aText
.
find
(
'\n'
,
begin
);
}
// Draw the last (or the only one) line
...
...
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