Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-12-26 23:08:32 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-12-26 23:08:41 +0300
commit20b438d523c9c2fb8577602c053b4f51267300b6 (patch)
treeacf6485f181c3176f60cc37a6e7b06934b89bb25 /source
parent5cf993f951bc87d006279f7e33b210a4341fca1b (diff)
Cleanup: Use array for BKE cursor functions
Missed this function in rB67525b88d2e
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_screen.h4
-rw-r--r--source/blender/blenkernel/intern/screen.c4
-rw-r--r--source/blender/editors/interface/interface_ops.c4
3 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index db4c66959c5..3d8b48e5192 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -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,
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 363e1f85575..6e352b6ba90 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -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(&region->winrct, x, y)) {
+ if (BLI_rcti_isect_pt_v(&region->winrct, xy)) {
return region;
}
}
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 35b621b0272..f7424066ad8 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -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;