From 5337bf1f6a72f51652b79d4dc2426d8f79339daa Mon Sep 17 00:00:00 2001 From: obligaron Date: Sat, 21 May 2022 19:07:11 +0200 Subject: [PATCH] Initialize Viewport in CalculatePanelAreas --- Source/control.cpp | 6 ++++++ Source/utils/display.cpp | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index b3c8daf21..119a069ea 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -436,6 +436,12 @@ void CalculatePanelAreas() RightPanel.position.x = gnScreenWidth - RightPanel.size.width - LeftPanel.position.x; } RightPanel.position.y = LeftPanel.position.y; + + gnViewportHeight = gnScreenHeight; + if (gnScreenWidth <= PANEL_WIDTH) { + // Part of the screen is fully obscured by the UI + gnViewportHeight -= PANEL_HEIGHT; + } } bool IsChatAvailable() diff --git a/Source/utils/display.cpp b/Source/utils/display.cpp index 4083a5e51..df1ac4390 100644 --- a/Source/utils/display.cpp +++ b/Source/utils/display.cpp @@ -135,12 +135,6 @@ void AdjustToScreenGeometry(Size windowSize) { gnScreenWidth = windowSize.width; gnScreenHeight = windowSize.height; - - gnViewportHeight = gnScreenHeight; - if (gnScreenWidth <= PANEL_WIDTH) { - // Part of the screen is fully obscured by the UI - gnViewportHeight -= PANEL_HEIGHT; - } } Size GetPreferredWindowSize()