1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 23:04:36 +01:00

Use ScreenRect::Contains to check for clicked area

This commit is contained in:
Hielke Morsink
2021-11-30 19:06:26 +01:00
parent a15d417d55
commit 2592b3a4ab

View File

@@ -1338,7 +1338,8 @@ 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;
if (screenCoords.x >= 2 && screenCoords.x <= 11)
const ScreenRect checkboxColumnRect{ { 2, 0 }, { 11, screenCoords.y } };
if (checkboxColumnRect.Contains(screenCoords))
{ // Checkbox was clicked
WindowTileInspectorToggleInvisibility(index);
}