Fix text wrapping bug that only happened under a specific scenario

was causing a broken string view if there was a line that had any space in it followed by a forced newline and then a line that had no spaces but was long enough to wrap. example:
A B\nThisLastLineHasNoSpacesButIsLongEnoughToWrapAnyways!!!!!!!!!!!!
This commit is contained in:
Kae 2024-04-15 11:10:33 +10:00
parent 227e60ca4c
commit 37d7262375

View File

@ -174,6 +174,7 @@ bool TextPainter::processWrapText(StringView text, unsigned* wrapWidth, WrapText
++lineStartIt;
// next line starts after the CR with no characters in it and no known splits.
lineCharSize = linePixelWidth = 0;
splitIt = end;
} else {
int charWidth = glyphWidth(character);