diff options
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 4a840b5ffbe..1c8a93981c7 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -748,19 +748,21 @@ ScrArea *BKE_screen_find_big_area(bScreen *sc, const int spacetype, const short return big; } -ScrArea *BKE_screen_find_area_xy(bScreen *sc, const int spacetype, int x, int y) +ScrArea *BKE_screen_area_map_find_area_xy(const ScrAreaMap *areamap, const int spacetype, int x, int y) { - ScrArea *sa, *sa_found = NULL; - - for (sa = sc->areabase.first; sa; sa = sa->next) { + for (ScrArea *sa = areamap->areabase.first; sa; sa = sa->next) { if (BLI_rcti_isect_pt(&sa->totrct, x, y)) { if ((spacetype == SPACE_TYPE_ANY) || (sa->spacetype == spacetype)) { - sa_found = sa; + return sa; } break; } } - return sa_found; + return NULL; +} +ScrArea *BKE_screen_find_area_xy(bScreen *sc, const int spacetype, int x, int y) +{ + return BKE_screen_area_map_find_area_xy(AREAMAP_FROM_SCREEN(sc), spacetype, x, y); } |