From bc69b0bf504ee606735cce5dcd403b7aa8500754 Mon Sep 17 00:00:00 2001 From: TheRazerMD Date: Mon, 26 Oct 2026 00:24:39 +0100 Subject: [PATCH] Centered the API row --- OptiScaler/menu/menu_common.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OptiScaler/menu/menu_common.cpp b/OptiScaler/menu/menu_common.cpp index 1369f3a2..6807636e 100644 --- a/OptiScaler/menu/menu_common.cpp +++ b/OptiScaler/menu/menu_common.cpp @@ -10183,7 +10183,7 @@ void MenuCommon::RenderHudlessResourcesWindow(RenderMenuContext& ctx, ImGuiWindo } } -// Game name | API | GPU | Input, above the tabs +// API | GPU | Input, above the tabs static void RenderGameInfoRow(State& state, const GpuInformation& primaryGpu) { // Game name is in the window title @@ -10193,7 +10193,18 @@ static void RenderGameInfoRow(State& state, const GpuInformation& primaryGpu) : IdentifyGpu::gameUsesVkd3dProton() ? " (VKD3D)" : "", primaryGpu.name.c_str(), ApiUpscalerInputName(state.currentInputApiName).c_str()); - ImGui::TextWrapped("%s", line.c_str()); + + const float avail = ImGui::GetContentRegionAvail().x; + const float textWidth = ImGui::CalcTextSize(line.c_str()).x; + if (textWidth < avail) + { + ImGui::SetCursorPosX(ImGui::GetCursorPosX() + (avail - textWidth) * 0.5f); + ImGui::TextUnformatted(line.c_str()); + } + else + { + ImGui::TextWrapped("%s", line.c_str()); + } } void MenuCommon::RenderMainMenuWindow(RenderMenuContext& ctx)