From 8129fcc190f658b65ed079a057f1494232f4610d Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 6 May 2024 21:05:09 +0200 Subject: [PATCH] AdjustCursor match --- src/nw4r/ut/ut_TextWriterBase.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/nw4r/ut/ut_TextWriterBase.cpp b/src/nw4r/ut/ut_TextWriterBase.cpp index c3fc3032..82c464a8 100644 --- a/src/nw4r/ut/ut_TextWriterBase.cpp +++ b/src/nw4r/ut/ut_TextWriterBase.cpp @@ -446,15 +446,13 @@ f32 TextWriterBase::AdjustCursor(f32 *x1, f32 *y1, const T *str, int len) { f32 textWidth = 0.0f; f32 textHeight = 0.0f; - if (!IsDrawFlagSet(0x333, 0x300) && !IsDrawFlagSet(0x333, 0)) { - Rect rect; - CalcStringRect(&rect, str, len); + if (!IsDrawFlagSet(0x333, 0x300)) { + if (!IsDrawFlagSet(0x333, 0)) { + Rect rect; + CalcStringRect(&rect, str, len); - textWidth = rect.left + rect.right; - textHeight = rect.top + rect.bottom; - - if (textWidth > mWidthLimit) { - textWidth = mWidthLimit; + textWidth = rect.left + rect.right; + textHeight = rect.top + rect.bottom; } }