1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Apply ScreenCoordsXY to some functions

This commit is contained in:
Gymnasiast
2020-03-07 22:20:16 +01:00
parent 27af60f062
commit 5f96a121ae
4 changed files with 39 additions and 39 deletions

View File

@@ -405,13 +405,13 @@ static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi)
* New function based on 6e914e
* returns -1 if index is invalid
*/
int32_t dropdown_index_from_point(int32_t x, int32_t y, rct_window* w)
int32_t dropdown_index_from_point(const ScreenCoordsXY& loc, rct_window* w)
{
int32_t top = y - w->windowPos.y - 2;
int32_t top = loc.y - w->windowPos.y - 2;
if (top < 0)
return -1;
int32_t left = x - w->windowPos.x;
int32_t left = loc.x - w->windowPos.x;
if (left >= w->width)
return -1;
left -= 2;