Fixed: keys without save_value caused reader to loop

Fixed: first line of multi line text value could cause warnings about whitespace
Fixed some copy/paste errors in choice style reading;
Text viewer correctly uses mask for first line

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@604 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-08-07 14:19:38 +00:00
parent 65d92667fc
commit 565ddc1e12
7 changed files with 14 additions and 11 deletions
+6 -1
View File
@@ -414,6 +414,11 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
line.top = style.padding_top;
// size of the line so far
RealSize line_size(lineLeft(dc, style, 0), 0);
while (line.top < style.height && line_size.width + 1 >= style.width - style.padding_right) {
// nothing fits on this line, move down one pixel
line.top += 1;
line_size.width = lineLeft(dc, style, line.top);
}
line.positions.push_back(line_size.width);
// The word we are currently reading
RealSize word_size;
@@ -513,7 +518,7 @@ bool TextViewer::prepareLinesScale(RotatedDC& dc, const vector<CharInfo>& chars,
while (line.top < style.height && line_size.width + 1 >= style.width - style.padding_right) {
// nothing fits on this line, move down one pixel
line.top += 1;
line_size = RealSize(lineLeft(dc, style, line.top), 0);
line_size.width = lineLeft(dc, style, line.top);
}
line.positions.push_back(line_size.width); // start position
}