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