Cleanup: Use array as a parameter for event x/y functions

This change simplifies the parameter list for these functions
and reduces the chance of typos mixing up array indices.

Missed in rB69102786047dccdcbaee0df6307a8c3364d28fe0
This commit is contained in:
2021-10-21 00:56:31 -04:00
parent 035dcdad90
commit 5297bf318e
3 changed files with 7 additions and 7 deletions

View File

@@ -799,14 +799,14 @@ bool ui_region_contains_rect_px(const ARegion *region, const rcti *rect_px)
* \{ */
/** Check if the cursor is over any popups. */
ARegion *ui_screen_region_find_mouse_over_ex(bScreen *screen, int x, int y)
ARegion *ui_screen_region_find_mouse_over_ex(bScreen *screen, const int xy[2])
{
LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) {
rcti winrct;
ui_region_winrct_get_no_margin(region, &winrct);
if (BLI_rcti_isect_pt(&winrct, x, y)) {
if (BLI_rcti_isect_pt_v(&winrct, xy)) {
return region;
}
}
@@ -815,7 +815,7 @@ ARegion *ui_screen_region_find_mouse_over_ex(bScreen *screen, int x, int y)
ARegion *ui_screen_region_find_mouse_over(bScreen *screen, const wmEvent *event)
{
return ui_screen_region_find_mouse_over_ex(screen, event->xy[0], event->xy[1]);
return ui_screen_region_find_mouse_over_ex(screen, event->xy);
}
/** \} */