From 944d0d03b36c2673d0c7fc387e2ce35b3bfb57ae Mon Sep 17 00:00:00 2001 From: twanvl Date: Mon, 30 Apr 2007 22:47:35 +0000 Subject: [PATCH] Fixed vertical alignment of ".." (i.e. cards with empty rule text) git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@314 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/render/text/viewer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/render/text/viewer.cpp b/src/render/text/viewer.cpp index c4b21c59..3992a56b 100644 --- a/src/render/text/viewer.cpp +++ b/src/render/text/viewer.cpp @@ -369,7 +369,7 @@ void TextViewer::prepareLines(RotatedDC& dc, const String& text, const TextStyle lines[0].line_height = style.symbol_font.font->defaultSymbolSize(ctx, style.symbol_font.size).height; } else { dc.SetFont(style.font, scale); - lines[0].line_height = dc.GetTextExtent(_(" ")).height; + lines[0].line_height = dc.GetCharHeight(); } } @@ -425,7 +425,11 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector& chars, line_height_multiplier = style.line_height_soft; } // Add size of the character - word_size = add_horizontal(word_size, c.size); + if (c.break_after != BREAK_LINE) { + // ^^ HACK: don't count the line height of tags, if they are the only thing on a line + // then the linebreak is 'ignored'. + word_size = add_horizontal(word_size, c.size); + } positions_word.push_back(word_size.width); // Did the word become too long? if (style.field().multi_line && !break_now) {