diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-15 11:10:33 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-04-15 11:10:33 +1000 |
commit | 37d72623759ecb36e738e5f6853293a8f021d628 (patch) | |
tree | 32228514baaf5ea87090c065485014f1a81ecc21 | |
parent | 227e60ca4c927ed9f6b7db5e5c53c45addd1428b (diff) |
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!!!!!!!!!!!!
-rw-r--r-- | source/rendering/StarTextPainter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/rendering/StarTextPainter.cpp b/source/rendering/StarTextPainter.cpp index 9891ad6..8e21488 100644 --- a/source/rendering/StarTextPainter.cpp +++ b/source/rendering/StarTextPainter.cpp @@ -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); |