fix off-by-one error in SimpleTextFormatter line splitting where last char of last word was sent to next line

This commit is contained in:
Dmitry Popov 2016-03-03 21:44:56 +07:00
parent 5d48ae8fc4
commit a59e876622
1 changed files with 2 additions and 2 deletions

View File

@ -502,8 +502,8 @@ struct SimpleTextFormatter {
if (ch == '\t' || ch == ' ') { if (ch == '\t' || ch == ' ') {
// track last word end // track last word end
if (prevChar != '\t' && prevChar != ' ' && prevChar != 0) { if (prevChar != '\t' && prevChar != ' ' && prevChar != 0) {
lastWordEnd = i - 1; lastWordEnd = i;
lastWordEndX = widths[i - 1]; lastWordEndX = widths[i];
} }
prevChar = ch; prevChar = ch;
continue; continue;