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
c209c534
Commit
c209c534
authored
Apr 14, 2008
by
twanvl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
symbol font: moved text_alignment to symbolsInFont
parent
5125e674
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
src/data/symbol_font.cpp
src/data/symbol_font.cpp
+7
-6
src/data/symbol_font.hpp
src/data/symbol_font.hpp
+0
-1
No files found.
src/data/symbol_font.cpp
View file @
c209c534
...
...
@@ -31,7 +31,6 @@ SymbolFont::SymbolFont()
:
img_size
(
12
)
,
spacing
(
1
,
1
)
,
scale_text
(
false
)
,
text_alignment
(
ALIGN_MIDDLE_CENTER
)
,
processed_insert_symbol_menu
(
nullptr
)
{}
...
...
@@ -59,7 +58,6 @@ IMPLEMENT_REFLECTION(SymbolFont) {
WITH_DYNAMIC_ARG
(
symbol_font_for_reading
,
this
);
REFLECT
(
symbols
);
REFLECT
(
scale_text
);
REFLECT
(
text_alignment
);
REFLECT
(
insert_symbol_menu
);
}
...
...
@@ -90,11 +88,12 @@ class SymbolInFont : public IntrusivePtrBase<SymbolInFont> {
bool
regex
;
///< Should this symbol be matched by a regex?
int
draw_text
;
///< The index of the captured regex expression to draw, or -1 to not draw text
wxRegEx
code_regex
;
///< Regex for matching the symbol code
FontP
text_font
;
///< Font to draw text in.
Alignment
text_alignment
;
double
text_margin_left
;
double
text_margin_right
;
double
text_margin_top
;
double
text_margin_bottom
;
FontP
text_font
;
///< Font to draw text in.
private:
ScriptableImage
image
;
///< The image for this symbol
double
img_size
;
///< Font size used by the image
...
...
@@ -110,6 +109,7 @@ SymbolInFont::SymbolInFont()
,
regex
(
false
)
,
draw_text
(
-
1
)
,
code_regex
()
,
text_alignment
(
ALIGN_MIDDLE_CENTER
)
,
text_margin_left
(
0
),
text_margin_right
(
0
)
,
text_margin_top
(
0
),
text_margin_bottom
(
0
)
,
actual_size
(
0
,
0
)
...
...
@@ -178,11 +178,12 @@ IMPLEMENT_REFLECTION(SymbolInFont) {
if
(
regex
)
code_regex
.
Compile
(
code
);
REFLECT
(
draw_text
);
REFLECT
(
text_font
);
REFLECT
(
text_alignment
);
REFLECT
(
text_margin_left
);
REFLECT
(
text_margin_right
);
REFLECT
(
text_margin_top
);
REFLECT
(
text_margin_bottom
);
REFLECT
(
text_font
);
REFLECT
(
image
);
REFLECT
(
enabled
);
REFLECT_N
(
"image font size"
,
img_size
);
...
...
@@ -311,7 +312,7 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size,
size
-=
dc
.
getFontSizeStep
();
}
// align text
RealPoint
text_pos
=
align_in_rect
(
text_alignment
,
ts
,
sym_rect
);
RealPoint
text_pos
=
align_in_rect
(
sym
.
text_alignment
,
ts
,
sym_rect
);
// draw text
dc
.
DrawTextWithShadow
(
text
,
*
sym
.
text_font
,
text_pos
,
font_size
,
stretch
);
}
...
...
@@ -351,7 +352,7 @@ Image SymbolFont::getImage(double font_size, const DrawableSymbol& sym) {
size
-=
rdc
.
getFontSizeStep
();
}
// align text
RealPoint
text_pos
=
align_in_rect
(
text_alignment
,
ts
,
sym_rect
);
RealPoint
text_pos
=
align_in_rect
(
sym
.
symbol
->
text_alignment
,
ts
,
sym_rect
);
// draw text
rdc
.
DrawTextWithShadow
(
sym
.
text
,
*
sym
.
symbol
->
text_font
,
text_pos
,
font_size
,
stretch
);
// done
...
...
src/data/symbol_font.hpp
View file @
c209c534
...
...
@@ -86,7 +86,6 @@ class SymbolFont : public Packaged {
RealSize
spacing
;
///< Spacing between sybmols (for the default font size)
// writing text
bool
scale_text
;
///< Should text be scaled down to fit in a symbol?
Alignment
text_alignment
;
InsertSymbolMenuP
insert_symbol_menu
;
wxMenu
*
processed_insert_symbol_menu
;
...
...
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