Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
magicseteditor
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
magicseteditor
Commits
a9414f88
Commit
a9414f88
authored
Jun 25, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't try to draw text on symbols if there is no font
parent
0a6a381d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/data/symbol_font.cpp
src/data/symbol_font.cpp
+2
-2
No files found.
src/data/symbol_font.cpp
View file @
a9414f88
...
@@ -285,7 +285,7 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size,
...
@@ -285,7 +285,7 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size,
dc
.
DrawBitmap
(
bmp
,
align_in_rect
(
align
,
dc
.
trInvS
(
RealSize
(
bmp
.
GetWidth
(),
bmp
.
GetHeight
())),
sym_rect
));
dc
.
DrawBitmap
(
bmp
,
align_in_rect
(
align
,
dc
.
trInvS
(
RealSize
(
bmp
.
GetWidth
(),
bmp
.
GetHeight
())),
sym_rect
));
// 2. draw text
// 2. draw text
if
(
text
.
empty
())
return
;
if
(
text
.
empty
()
||
!
sym
.
text_font
)
return
;
// subtract margins from size
// subtract margins from size
sym_rect
.
x
+=
font_size
*
sym
.
text_margin_left
;
sym_rect
.
x
+=
font_size
*
sym
.
text_margin_left
;
sym_rect
.
y
+=
font_size
*
sym
.
text_margin_top
;
sym_rect
.
y
+=
font_size
*
sym
.
text_margin_top
;
...
@@ -319,7 +319,7 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size,
...
@@ -319,7 +319,7 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size,
Image
SymbolFont
::
getImage
(
double
font_size
,
const
DrawableSymbol
&
sym
)
{
Image
SymbolFont
::
getImage
(
double
font_size
,
const
DrawableSymbol
&
sym
)
{
if
(
!
sym
.
symbol
)
return
Image
(
1
,
1
);
if
(
!
sym
.
symbol
)
return
Image
(
1
,
1
);
if
(
sym
.
draw_text
.
empty
())
return
sym
.
symbol
->
getImage
(
*
this
,
font_size
);
if
(
sym
.
draw_text
.
empty
()
||
!
sym
.
symbol
->
text_font
)
return
sym
.
symbol
->
getImage
(
*
this
,
font_size
);
// with text
// with text
Bitmap
bmp
(
sym
.
symbol
->
getImage
(
*
this
,
font_size
));
Bitmap
bmp
(
sym
.
symbol
->
getImage
(
*
this
,
font_size
));
// memory dc to work with
// memory dc to work with
...
...
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