diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-07-02 17:48:18 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-07-02 17:56:54 +0300 |
commit | bea364fe2a37222fc8737afdb508ca81e1b89e68 (patch) | |
tree | 3002dbb7be5056b9364d2e34d787e2b776e6aee7 /source/blender/blenkernel | |
parent | 878b09562cd5617dea32dbc354ebb484def99f8b (diff) |
Fix: Global area edges couldn't call right click menu to join/split
Operators ignored edges along the screen-layout bounds. They should've ignored
those along window bounds instead.
Although the global areas can not be joined/split, the adjacent areas can. So
the menu should still be shown.
Had to change the return value of area joining operator, so that an error report
can show up when trying to join over a global area edge. Think this is fine to
do, but you never know with such stuff.
Preferably we'd gray out the "Join Area" item in the menu when clicking on the
edge of a global area. Unfotunately the operator uses coordinates passed as
operator properties to find the right edge/areas, which we cannot access from
the poll callback.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_screen.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 14 |
2 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index b6ddb8f57be..861b47aebc6 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -333,6 +333,7 @@ struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa); struct ARegion *BKE_area_find_region_xy(struct ScrArea *sa, const int regiontype, int x, int y); struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc, struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2); struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min); +struct ScrArea *BKE_screen_area_map_find_area_xy(const struct ScrAreaMap *areamap, const int spacetype, int x, int y); struct ScrArea *BKE_screen_find_area_xy(struct bScreen *sc, const int spacetype, int x, int y); unsigned int BKE_screen_view3d_layer_active_ex( 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); } |