Commit 1dd20bcd authored by twanvl's avatar twanvl

"scale down to" works for single line text boxes, fixes #53

parent d7f6c320
...@@ -554,10 +554,13 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars, ...@@ -554,10 +554,13 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
positions_word.push_back(word_size.width); positions_word.push_back(word_size.width);
if (!c.soft) word_end_or_soft = i + 1; if (!c.soft) word_end_or_soft = i + 1;
// Did the word become too long? // Did the word become too long?
if (style.field().multi_line && !break_now) { if (!break_now) {
double max_width = lineRight(dc, style, line.top); double max_width = lineRight(dc, style, line.top);
if (line_size.width + word_size.width > max_width) { 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 // single word on this line; the word is too long
if (stop_if_too_long) { if (stop_if_too_long) {
return false; // just give up return false; // just give up
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment