WordWrapString: Fix state after starting a new line
After starting a new line, we restart the processing from the line break position, so we need to set `nextCodepoint` correctly. Fixes #3449
This commit is contained in:
parent
e3dc241c2f
commit
bc9031ad54
2 changed files with 3 additions and 2 deletions
|
|
@ -327,6 +327,7 @@ std::string WordWrapString(string_view text, size_t width, GameFontTables size,
|
|||
processedEnd = remaining.data();
|
||||
lastBreakablePos = -1;
|
||||
lineWidth = 0;
|
||||
nextCodepoint = !remaining.empty() ? DecodeFirstUtf8CodePoint(remaining, &nextCodepointLen) : U'\0';
|
||||
} while (!remaining.empty() && remaining[0] != '\0');
|
||||
output.append(processedEnd, remaining.data());
|
||||
return output;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue