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:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user