From dd6096dde9131224ee2c7e526d1f920da3ee72ce Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Thu, 10 Aug 2023 17:58:37 +0200 Subject: [PATCH] fixup! Add automatic GUI scale selection --- libs/s25main/desktops/dskOptions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/s25main/desktops/dskOptions.cpp b/libs/s25main/desktops/dskOptions.cpp index 774dd9736..244ad7288 100644 --- a/libs/s25main/desktops/dskOptions.cpp +++ b/libs/s25main/desktops/dskOptions.cpp @@ -760,14 +760,14 @@ void dskOptions::scrollGuiScale(bool up) const auto& selection = combo->GetSelection(); unsigned newSelection = 0; if(!selection || *selection == 0) // No selection or "Auto" item selected - newSelection = recommendedGuiScaleIndex_ + 1; + newSelection = recommendedGuiScaleIndex_; else newSelection = std::clamp(*selection + (up ? 1 : -1), 1u, static_cast(combo->GetNumItems() - 1)); if(newSelection != selection) { combo->SetSelection(newSelection); - SETTINGS.video.guiScale = guiScales_[newSelection - 1]; + SETTINGS.video.guiScale = guiScales_[newSelection]; VIDEODRIVER.setGuiScalePercent(SETTINGS.video.guiScale); } }