mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 21:06:59 -04:00
don't include spacing in symbol font text drawing alignment&size calculations
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1119 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -283,10 +283,14 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size,
|
||||
// find bitmap
|
||||
Bitmap bmp = sym.getBitmap(*this, dc.trS(font_size));
|
||||
// draw aligned in the rectangle
|
||||
dc.DrawBitmap(bmp, align_in_rect(align, dc.trInvS(RealSize(bmp.GetWidth(), bmp.GetHeight())), sym_rect));
|
||||
RealSize bmp_size = dc.trInvS(RealSize(bmp));
|
||||
RealPoint bmp_pos = align_in_rect(align, bmp_size, sym_rect);
|
||||
dc.DrawBitmap(bmp, bmp_pos);
|
||||
|
||||
// 2. draw text
|
||||
if (text.empty() || !sym.text_font) return;
|
||||
// only use the bitmap rectangle
|
||||
sym_rect = RealRect(bmp_pos, bmp_size);
|
||||
// subtract margins from size
|
||||
sym_rect.x += font_size * sym.text_margin_left;
|
||||
sym_rect.y += font_size * sym.text_margin_top;
|
||||
|
||||
Reference in New Issue
Block a user