1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 03:05:24 +01:00

Fix scenery window invalidating every frame unnecessarily

This commit is contained in:
mix
2025-05-17 03:23:44 +01:00
parent 0b5fb11be9
commit 4864b6552c

View File

@@ -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();