From 34929bc4e57d9bd8facaaec7354b30bec2945d12 Mon Sep 17 00:00:00 2001 From: twanvl Date: Tue, 3 Aug 2010 01:21:58 +0000 Subject: [PATCH] "scale down to" works for single line text boxes, fixes #53 git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1465 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/render/text/viewer.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/render/text/viewer.cpp b/src/render/text/viewer.cpp index 86a1e3ba..bf69e958 100644 --- a/src/render/text/viewer.cpp +++ b/src/render/text/viewer.cpp @@ -554,10 +554,13 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector& chars, positions_word.push_back(word_size.width); if (!c.soft) word_end_or_soft = i + 1; // Did the word become too long? - if (style.field().multi_line && !break_now) { + if (!break_now) { double max_width = lineRight(dc, style, line.top); if (line_size.width + word_size.width > max_width) { - if (word_start == line.start) { + if (!style.field().multi_line) { + // single line word does not fit + return false; + } else if (word_start == line.start) { // single word on this line; the word is too long if (stop_if_too_long) { return false; // just give up