From 426eba77da165ecaa84fdefd40f6d6029c4b68df Mon Sep 17 00:00:00 2001 From: cyanea-bt <150618858+cyanea-bt@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:29:09 +0200 Subject: [PATCH] fix TextWindow formatting/line splits lines equal in length to the window's width limit were split up one word/character too early and did not match with the original LRR --- src/openlrr/engine/drawing/TextWindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openlrr/engine/drawing/TextWindow.cpp b/src/openlrr/engine/drawing/TextWindow.cpp index ec949f8..8292f64 100644 --- a/src/openlrr/engine/drawing/TextWindow.cpp +++ b/src/openlrr/engine/drawing/TextWindow.cpp @@ -207,9 +207,9 @@ bool32 __cdecl Gods98::TextWindow_Update(TextWindow* window, uint32 posFromEnd, if ((uint8)c == 203) charWidth = 0; currWidth += charWidth; wordWidth += charWidth; - if (currWidth >= window->windowSize.width) { + if (currWidth > window->windowSize.width) { // Check to see if the word is longer than the line - if (wordWidth >= window->windowSize.width) { + if (wordWidth > window->windowSize.width) { // If so, split the word onto the next line window->lineList[window->usedLines] = loop; lineWidthList[window->usedLines-1] = currWidth-charWidth; @@ -513,4 +513,4 @@ void __cdecl Gods98::TextWindow_SetFont(TextWindow* window, Font* font) window->font = font; } -#pragma endregion \ No newline at end of file +#pragma endregion