[Scummvm-git-logs] scummvm branch-2-7 -> 14d47b8b2c0abe925881d297ba0c8915c7bd4015

lephilousophe noreply at scummvm.org
Sun Feb 5 17:03:26 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:
14d47b8b2c GUI: Fix width and height calculation


Commit: 14d47b8b2c0abe925881d297ba0c8915c7bd4015
    https://github.com/scummvm/scummvm/commit/14d47b8b2c0abe925881d297ba0c8915c7bd4015
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-02-05T18:03:16+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