Skip to content

Commit ac8edf9

Browse files
committed
Fix check for GUI scaling support in AUTO mode
The check wrongly returned true as in AUTO mode the value is "0" and hence always "!= 100". Check the 2 cases (AUTO/SPECIFIC) directly.
1 parent c338f29 commit ac8edf9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

libs/s25main/desktops/dskOptions.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,12 @@ void dskOptions::Msg_ButtonClick(const unsigned ctrl_id)
644644

645645
// Is the selected backend required to support GUI scaling to fulfill the user's choice?
646646
// If so, warn the user if the backend is unable to support GUI scaling.
647-
if(VIDEODRIVER.getGuiScale().percent() == 100
648-
&& (SETTINGS.video.guiScale != 100
649-
|| (SETTINGS.video.guiScale == 0 && VIDEODRIVER.getGuiScaleRange().recommendedPercent != 100)))
647+
const auto requestedGuiScale = SETTINGS.video.guiScale;
648+
const bool autoGuiScale = requestedGuiScale == 0;
649+
if((!autoGuiScale && requestedGuiScale != VIDEODRIVER.getGuiScale().percent())
650+
|| (autoGuiScale
651+
&& VIDEODRIVER.getGuiScaleRange().recommendedPercent != VIDEODRIVER.getGuiScale().percent()))
652+
650653
{
651654
WINDOWMANAGER.Show(std::make_unique<iwMsgbox>(
652655
_("Sorry!"), _("The selected video driver does not support GUI scaling! Setting won't be used."),

0 commit comments

Comments
 (0)