From 45c66d1ac2908951eda1944db0565153932922f8 Mon Sep 17 00:00:00 2001 From: DeaTh-G Date: Sun, 26 Jan 2025 16:56:42 +0100 Subject: [PATCH] fix option names being split to multiple lines --- UnleashedRecomp/ui/imgui_utils.cpp | 4 ++-- UnleashedRecomp/ui/options_menu.cpp | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/UnleashedRecomp/ui/imgui_utils.cpp b/UnleashedRecomp/ui/imgui_utils.cpp index 00952aef..d64bbbe2 100644 --- a/UnleashedRecomp/ui/imgui_utils.cpp +++ b/UnleashedRecomp/ui/imgui_utils.cpp @@ -211,7 +211,7 @@ void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& pos, ( font, fontSize, - rectWidth, + FLT_MAX, { textX, position.y }, 0.0f, text, @@ -232,7 +232,7 @@ void DrawTextWithMarquee(const ImFont* font, float fontSize, const ImVec2& pos, ( font, fontSize, - rectWidth, + FLT_MAX, { textX + textSize.x + rectWidth, position.y }, 0.0f, text, diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index c03e08da..1f701e31 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -751,11 +751,13 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef* conf } else { + drawList->PushClipRect(min, max, true); + DrawRubyAnnotatedText ( g_seuratFont, size, - textClipRect.z - textClipRect.x, + FLT_MAX, textPos, 0.0f, configName.c_str(), @@ -768,6 +770,8 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef* conf DrawTextBasic(g_seuratFont, annotationSize, pos, textColour, str); } ); + + drawList->PopClipRect(); } // Right side