aboutsummaryrefslogtreecommitdiff
path: root/src/frontend
diff options
context:
space:
mode:
authorgal20 <71563441+gal20@users.noreply.github.com>2021-12-04 16:21:33 +0200
committergal20 <71563441+gal20@users.noreply.github.com>2022-01-05 21:03:13 +0200
commitdfb2111a000038e304d7d416b182e85be3425040 (patch)
tree2e6fdc4e2828af16fc8947777c3668804603d70f /src/frontend
parentc4cd9da674bcfb8dca89086ce3ffa2d3b03438eb (diff)
Fix screen scaling
The screen gap wasn't multiplied by the scaling factor, causing the result to be too low Additionally, results of division should be rounded up
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/qt_sdl/main.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp
index bf7c261..31bb3c0 100644
--- a/src/frontend/qt_sdl/main.cpp
+++ b/src/frontend/qt_sdl/main.cpp
@@ -749,7 +749,7 @@ void ScreenHandler::screenSetupLayout(int w, int h)
QSize ScreenHandler::screenGetMinSize(int factor = 1)
{
bool isHori = (Config::ScreenRotation == 1 || Config::ScreenRotation == 3);
- int gap = Config::ScreenGap;
+ int gap = Config::ScreenGap * factor;
int w = 256 * factor;
int h = 192 * factor;
@@ -778,9 +778,9 @@ QSize ScreenHandler::screenGetMinSize(int factor = 1)
else // hybrid
{
if (isHori)
- return QSize(h+gap+h, 3*w +(4*gap) / 3);
+ return QSize(h+gap+h, 3*w + (int)ceil((4*gap) / 3.0));
else
- return QSize(3*w +(4*gap) / 3, h+gap+h);
+ return QSize(3*w + (int)ceil((4*gap) / 3.0), h+gap+h);
}
}