Cleanup: Use array for BKE cursor functions
Missed this function in rB67525b88d2e
This commit is contained in:
parent
5cf993f951
commit
20b438d523
Notes:
blender-bot
2023-02-14 08:29:54 +01:00
Referenced by issue #94852, Crash with Geometry Proximity node if input is points Referenced by issue #94608, switching to local view slower than previous builds Referenced by issue #94464, Blender Video texture not refreshing Referenced by issue #94454, Crash in nvoglv64.dll entering edit mode on curve
|
@ -473,8 +473,8 @@ struct ARegion *BKE_area_find_region_xy(struct ScrArea *area,
|
|||
*/
|
||||
struct ARegion *BKE_screen_find_region_xy(struct bScreen *screen,
|
||||
const int regiontype,
|
||||
int x,
|
||||
int y) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
|
||||
const int xy[2]) ATTR_WARN_UNUSED_RESULT
|
||||
ATTR_NONNULL(1, 3);
|
||||
|
||||
struct ARegion *BKE_screen_find_main_region_at_xy(struct bScreen *screen,
|
||||
const int space_type,
|
||||
|
|
|
@ -916,11 +916,11 @@ ARegion *BKE_area_find_region_xy(ScrArea *area, const int regiontype, const int
|
|||
return NULL;
|
||||
}
|
||||
|
||||
ARegion *BKE_screen_find_region_xy(bScreen *screen, const int regiontype, int x, int y)
|
||||
ARegion *BKE_screen_find_region_xy(bScreen *screen, const int regiontype, const int xy[2])
|
||||
{
|
||||
LISTBASE_FOREACH (ARegion *, region, &screen->regionbase) {
|
||||
if (ELEM(regiontype, RGN_TYPE_ANY, region->regiontype)) {
|
||||
if (BLI_rcti_isect_pt(®ion->winrct, x, y)) {
|
||||
if (BLI_rcti_isect_pt_v(®ion->winrct, xy)) {
|
||||
return region;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1753,9 +1753,7 @@ static int ui_button_press_invoke(bContext *C, wmOperator *op, const wmEvent *ev
|
|||
bScreen *screen = CTX_wm_screen(C);
|
||||
const bool skip_depressed = RNA_boolean_get(op->ptr, "skip_depressed");
|
||||
ARegion *region_prev = CTX_wm_region(C);
|
||||
ARegion *region = screen ? BKE_screen_find_region_xy(
|
||||
screen, RGN_TYPE_ANY, event->xy[0], event->xy[1]) :
|
||||
NULL;
|
||||
ARegion *region = screen ? BKE_screen_find_region_xy(screen, RGN_TYPE_ANY, event->xy) : NULL;
|
||||
|
||||
if (region == NULL) {
|
||||
region = region_prev;
|
||||
|
|
Loading…
Reference in New Issue