From 37d72623759ecb36e738e5f6853293a8f021d628 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:10:33 +1000 Subject: [PATCH] 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!!!!!!!!!!!! --- source/rendering/StarTextPainter.cpp | 1 + 1 file changed, 1 insertion(+) 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);