diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index dd36ffae21..5016412d86 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -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); }