libtxt: fix bug in calculating line end positions excluding whitespace (flutter/engine#5459)

Fixes https://github.com/flutter/flutter/issues/18014
This commit is contained in:
Jason Simmons
2018-06-04 13:28:38 -07:00
committed by GitHub
parent c853d53156
commit 455786e30a

View File

@@ -303,7 +303,7 @@ bool Paragraph::ComputeLineBreaks() {
(hard_break && line_end < text_.size()) ? line_end + 1 : line_end;
size_t line_end_excluding_whitespace = line_end;
while (
line_end_excluding_whitespace > 0 &&
line_end_excluding_whitespace > line_start &&
minikin::isLineEndSpace(text_[line_end_excluding_whitespace - 1])) {
line_end_excluding_whitespace--;
}