From 63bbc893ed9840cef6fb4347ed1d9cfeed50ddd2 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 20 Apr 2025 14:54:54 +0200 Subject: [PATCH] Tweak initial dimensions to account for optional scrollbars --- src/openrct2-ui/windows/Map.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 03f513a7c6..27d3b493c7 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1190,13 +1190,14 @@ namespace OpenRCT2::Ui::Windows void SetInitialWindowDimensions() { // The initial mini map size should be able to show a reasonably sized map - auto initSize = std::clamp(getPracticalMapSize(), 100, 254) * 2; - width = initSize + GetReservedRightSpace(); - height = initSize + kReservedTopSpace + GetReservedBottomSpace(); + auto initWidth = std::clamp(getPracticalMapSize(), 100, 254) * 2; + width = initWidth + GetReservedRightSpace(); - auto scrollbarSize = getPracticalMapSize() > 254 ? kScrollBarWidth : 2; - width += scrollbarSize; - height += scrollbarSize; + auto initHeight = std::clamp(getMiniMapWidth(), 100, 254) * 2; + height = initHeight + kReservedTopSpace + GetReservedBottomSpace(); + + width += getPracticalMapSize() > initWidth ? kScrollBarWidth : 2; + height += getMiniMapWidth() > initHeight ? kScrollBarWidth : 2; auto maxWindowHeight = ContextGetHeight() - 68; width = std::min(width, ContextGetWidth());