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