"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
This commit is contained in:
twanvl
2010-08-03 01:21:58 +00:00
parent 69ea39c64f
commit 34929bc4e5
+5 -2
View File
@@ -554,10 +554,13 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& 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