mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-11 21:27:01 -04:00
"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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user