[Scummvm-git-logs] scummvm master -> ecea1d5c396f51617ec4c55ae80d30979575e583
lephilousophe
noreply at scummvm.org
Sun Feb 5 17:02:51 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ecea1d5c39 GUI: Fix width and height calculation
Commit: ecea1d5c396f51617ec4c55ae80d30979575e583
https://github.com/scummvm/scummvm/commit/ecea1d5c396f51617ec4c55ae80d30979575e583
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-02-05T18:00:24+01:00
Commit Message:
GUI: Fix width and height calculation
_defaultW and _defaultH are already scaled and should not be scaled
again
Changed paths:
gui/ThemeLayout.cpp
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 66a3e2a05a8..41f0cbb8b4f 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -229,8 +229,8 @@ void ThemeLayoutMain::reflowLayout(Widget *widgetChain) {
} else if (_overlays == "screen_center") {
_x = -1;
_y = -1;
- _w = _defaultW > 0 ? MIN(_defaultW, g_gui.getGUIWidth()) * g_gui.getScaleFactor() : -1;
- _h = _defaultH > 0 ? MIN(_defaultH, g_gui.getGUIHeight()) * g_gui.getScaleFactor() : -1;
+ _w = _defaultW > 0 ? MIN(_defaultW, (int16)(g_gui.getGUIWidth() * g_gui.getScaleFactor())) : -1;
+ _h = _defaultH > 0 ? MIN(_defaultH, (int16)(g_gui.getGUIHeight() * g_gui.getScaleFactor())) : -1;
} else {
if (!g_gui.xmlEval()->getWidgetData(_overlays, _x, _y, _w, _h)) {
warning("Unable to retrieve overlayed dialog position %s", _overlays.c_str());
More information about the Scummvm-git-logs
mailing list