mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
cleaned up magic keywords; correct drawing of placeholders
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@235 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -108,7 +108,7 @@ struct TextElementsFromString {
|
||||
te.elements.push_back(new_shared5<SymbolTextElement>(text, pos, pos + 1, style.symbol_font, &ctx));
|
||||
} else {
|
||||
te.elements.push_back(new_shared6<FontTextElement> (text, pos, pos + 1,
|
||||
style.font.make(bold > 0, italic > 0),
|
||||
style.font.make(bold > 0, italic > 0, soft > 0 || kwpph > 0),
|
||||
soft > 0 ? DRAW_ACTIVE : DRAW_NORMAL,
|
||||
line > 0 ? BREAK_LINE : BREAK_HARD));
|
||||
}
|
||||
|
||||
@@ -15,21 +15,14 @@ void FontTextElement::draw(RotatedDC& dc, double scale, const RealRect& rect, co
|
||||
if ((what & draw_as) != draw_as) return; // don't draw
|
||||
dc.SetFont(font->font, font->size * scale);
|
||||
if (end != start && text.substr(end-1, 1) == _("\n")) end -= 1; // don't draw the newline character at the end
|
||||
if (draw_as == DRAW_ACTIVE) {
|
||||
// we are drawing a separator
|
||||
dc.SetTextForeground(font->separator_color);
|
||||
dc.DrawText(text.substr(start, end-start), rect.position());
|
||||
} else {
|
||||
// draw normally
|
||||
// draw shadow
|
||||
if (font->hasShadow()) {
|
||||
dc.SetTextForeground(font->shadow_color);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position() + font->shadow_displacement);
|
||||
}
|
||||
// draw
|
||||
dc.SetTextForeground(font->color);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position());
|
||||
// draw shadow
|
||||
if (font->hasShadow()) {
|
||||
dc.SetTextForeground(font->shadow_color);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position() + font->shadow_displacement);
|
||||
}
|
||||
// draw
|
||||
dc.SetTextForeground(font->color);
|
||||
dc.DrawText(text.substr(start, end - start), rect.position());
|
||||
}
|
||||
|
||||
void FontTextElement::getCharInfo(RotatedDC& dc, double scale, vector<CharInfo>& out) const {
|
||||
|
||||
Reference in New Issue
Block a user