From 6215bbd6dcef0461b01c0be0706dce46331b664a Mon Sep 17 00:00:00 2001 From: twanvl Date: Sun, 18 May 2008 20:30:16 +0000 Subject: [PATCH] Fixed exporting of symbol font images without text git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@866 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/data/symbol_font.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/data/symbol_font.cpp b/src/data/symbol_font.cpp index 3a065a6e..caa14b71 100644 --- a/src/data/symbol_font.cpp +++ b/src/data/symbol_font.cpp @@ -318,8 +318,9 @@ void SymbolFont::drawSymbol(RotatedDC& dc, RealRect sym_rect, double font_size, } Image SymbolFont::getImage(double font_size, const DrawableSymbol& sym) { - if (!sym.symbol || !sym.symbol->text_font) - return Image(1,1); + if (!sym.symbol) return Image(1,1); + if (sym.draw_text.empty()) return sym.symbol->getImage(*this, font_size); + // with text Bitmap bmp(sym.symbol->getImage(*this, font_size)); // memory dc to work with wxMemoryDC dc; @@ -338,7 +339,7 @@ Image SymbolFont::getImage(double font_size, const DrawableSymbol& sym) { while (true) { if (size <= 0) return sym.symbol->getImage(*this, font_size); // text too small rdc.SetFont(*sym.symbol->text_font, size / sym.symbol->text_font->size); - ts = rdc.GetTextExtent(sym.text); + ts = rdc.GetTextExtent(sym.draw_text); if (ts.height <= sym_rect.height) { if (ts.width <= sym_rect.width) { break; // text fits