From 4864b6552cad5c82b09b1fc59b38bbac92d3267a Mon Sep 17 00:00:00 2001 From: mix Date: Sat, 17 May 2025 03:23:44 +0100 Subject: [PATCH] Fix scenery window invalidating every frame unnecessarily --- src/openrct2-ui/windows/Scenery.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 3f3a2c7d69..50742b8e4b 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -452,6 +452,7 @@ namespace OpenRCT2::Ui::Windows // This will happen when the mouse leaves the scroll window and is required so that the cost and description // switch to the tool scenery selection. _selectedScenery = {}; + Invalidate(); } } @@ -525,8 +526,6 @@ namespace OpenRCT2::Ui::Windows InvalidateWidget(WIDX_FILTER_TEXT_BOX); } - Invalidate(); - if (!isToolActive(WindowClass::Scenery)) { Close(); @@ -1523,7 +1522,7 @@ namespace OpenRCT2::Ui::Windows void ContentScrollMouseOver(const ScreenCoordsXY& screenCoords) { ScenerySelection scenery = GetSceneryIdByCursorPos(screenCoords); - if (!scenery.IsUndefined()) + if (!scenery.IsUndefined() && _selectedScenery != scenery) { _selectedScenery = scenery; Invalidate();