From 11b44b78f7357c43cf61eba617844205065ff39c Mon Sep 17 00:00:00 2001 From: loki5512344 Date: Sat, 3 Oct 2026 13:31:38 +0000 Subject: [PATCH] Apply explicit GUI scale as is Explicitly chosen scale is no longer reduced to fit the open menu page (2 stayed 1.5 in settings). Fitting to the window remains in auto mode. --- res/layouts/pages/settings_display.xml.lua | 8 ++------ res/texts/ru_RU.txt | 1 - src/graphics/ui/GUI.cpp | 5 +++-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/res/layouts/pages/settings_display.xml.lua b/res/layouts/pages/settings_display.xml.lua index e7f58f8ef..446d6b4b3 100644 --- a/res/layouts/pages/settings_display.xml.lua +++ b/res/layouts/pages/settings_display.xml.lua @@ -11,12 +11,8 @@ end tostring_overrides["display.gui-scale"] = function(x) if x == 0 then - return string.format("%s (%d)", gui.str("Auto"), gui.get_max_scale()) - end - local effective = gui.get_scale() - if effective ~= x then - -- menu is limited by window size - return string.format("%s (%s %s)", tostring(x), gui.str("Effective"), tostring(effective)) + -- the scale chosen automatically for the current window + return string.format("%s (%s)", gui.str("Auto"), tostring(gui.get_scale())) end return tostring(x) end diff --git a/res/texts/ru_RU.txt b/res/texts/ru_RU.txt index 68f654d98..bf5032042 100644 --- a/res/texts/ru_RU.txt +++ b/res/texts/ru_RU.txt @@ -13,7 +13,6 @@ Description=Описание Converting world...=Выполняется конвертация мира... Unlimited=Неограниченно Auto=Авто -Effective=действует Chat=Чат Console=Консоль Log=Лог diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 871cc702f..d74c5bda6 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -110,9 +110,10 @@ float GUI::calcScale(const glm::uvec2& viewport) const { ? static_cast(calcMaxScale(viewport)) // auto : value; - // while a menu page is open, it must fit the window + // explicitly set scale is applied as is; in auto mode an open menu page + // must fit the window auto& page = menu->getCurrent(); - if (page.panel) { + if (value <= 0.0f && page.panel) { auto size = page.panel->getSize(); if (size.x > 0.0f && size.y > 0.0f) { float fit = std::min(viewport.x / size.x, viewport.y / size.y);