GUI: Fix width and height calculation

_defaultW and _defaultH are already scaled and should not be scaled
again
This commit is contained in:
Le Philousophe 2023-02-05 18:00:24 +01:00
parent f6654b8b1f
commit ecea1d5c39

View file

@ -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());