1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

reserved screen area in portrait mode

This commit is contained in:
Laserlicht
2025-09-12 02:08:08 +02:00
parent 8973e4ba47
commit 838e77c491

View File

@@ -48,6 +48,8 @@ std::tuple<int, int> ScreenHandler::getSupportedScalingRange() const
Point renderResolution = getRenderResolution(); Point renderResolution = getRenderResolution();
double reservedAreaWidth = settings["video"]["reservedWidth"].Float(); double reservedAreaWidth = settings["video"]["reservedWidth"].Float();
Point availableResolution = Point(renderResolution.x * (1 - reservedAreaWidth), renderResolution.y); Point availableResolution = Point(renderResolution.x * (1 - reservedAreaWidth), renderResolution.y);
if(renderResolution.x < renderResolution.y) // reserved in portrait mode
availableResolution = Point(renderResolution.x, renderResolution.y * (1 - reservedAreaWidth));
double maximalScalingWidth = 100.0 * availableResolution.x / minResolution.x; double maximalScalingWidth = 100.0 * availableResolution.x / minResolution.x;
double maximalScalingHeight = 100.0 * availableResolution.y / minResolution.y; double maximalScalingHeight = 100.0 * availableResolution.y / minResolution.y;