1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Properly handle clicking below the list

This commit is contained in:
Hielke Morsink
2021-11-30 19:07:39 +01:00
parent 2592b3a4ab
commit 68c7279f4f

View File

@@ -1339,7 +1339,7 @@ static void WindowTileInspectorScrollmousedown(rct_window* w, int32_t scrollInde
// Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements
const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1;
const ScreenRect checkboxColumnRect{ { 2, 0 }, { 11, screenCoords.y } };
if (checkboxColumnRect.Contains(screenCoords))
if (index >= 0 && checkboxColumnRect.Contains(screenCoords))
{ // Checkbox was clicked
WindowTileInspectorToggleInvisibility(index);
}