mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-14 21:37:42 -07:00
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
This commit is contained in:
parent
c4cd9da674
commit
dfb2111a00
@ -749,7 +749,7 @@ void ScreenHandler::screenSetupLayout(int w, int h)
|
|||||||
QSize ScreenHandler::screenGetMinSize(int factor = 1)
|
QSize ScreenHandler::screenGetMinSize(int factor = 1)
|
||||||
{
|
{
|
||||||
bool isHori = (Config::ScreenRotation == 1 || Config::ScreenRotation == 3);
|
bool isHori = (Config::ScreenRotation == 1 || Config::ScreenRotation == 3);
|
||||||
int gap = Config::ScreenGap;
|
int gap = Config::ScreenGap * factor;
|
||||||
|
|
||||||
int w = 256 * factor;
|
int w = 256 * factor;
|
||||||
int h = 192 * factor;
|
int h = 192 * factor;
|
||||||
@ -778,9 +778,9 @@ QSize ScreenHandler::screenGetMinSize(int factor = 1)
|
|||||||
else // hybrid
|
else // hybrid
|
||||||
{
|
{
|
||||||
if (isHori)
|
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
|
else
|
||||||
return QSize(3*w +(4*gap) / 3, h+gap+h);
|
return QSize(3*w + (int)ceil((4*gap) / 3.0), h+gap+h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user