diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 1775a0c55a2..8a5b30df1a4 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1052,16 +1052,11 @@ static void region_azones_scrollbars_initialize(ScrArea *sa, ARegion *ar) } /* *************************************************************** */ - -static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *ar, const int alignment) +static void region_azones_add_edge(ScrArea *sa, + ARegion *ar, + const int alignment, + const bool is_fullscreen) { - const bool is_fullscreen = screen->state == SCREENFULL; - - /* Only display tab or icons when the header region is hidden - * (not the tool header - they overlap). */ - if (ar->regiontype == RGN_TYPE_TOOL_HEADER) { - return; - } /* edge code (t b l r) is along which area edge azone will be drawn */ if (alignment == RGN_ALIGN_TOP) { @@ -1077,6 +1072,27 @@ static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *ar, c region_azone_edge_initialize(sa, ar, AE_RIGHT_TO_TOPLEFT, is_fullscreen); } +} + +static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *ar) +{ + const bool is_fullscreen = screen->state == SCREENFULL; + + /* Only display tab or icons when the header region is hidden + * (not the tool header - they overlap). */ + if (ar->regiontype == RGN_TYPE_TOOL_HEADER) { + return; + } + + region_azones_add_edge(sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment), is_fullscreen); + + /* For a split region also continue the azone edge from the next region if this region is aligned + * with the next */ + if ((ar->alignment & RGN_SPLIT_PREV) && ar->prev) { + region_azones_add_edge( + sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->prev->alignment), is_fullscreen); + } + if (is_fullscreen) { fullscreen_azone_initialize(sa, ar); } @@ -1695,7 +1711,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar } /* Some AZones use View2D data which is only updated in region init, so call that first! */ - region_azones_add(screen, area, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment)); + region_azones_add(screen, area, ar); } ED_area_azones_update(area, &win->eventstate->x); @@ -1766,7 +1782,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) } /* Some AZones use View2D data which is only updated in region init, so call that first! */ - region_azones_add(screen, sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment)); + region_azones_add(screen, sa, ar); } /* Avoid re-initializing tools while resizing the window. */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 885cd1ee77d..72fec68070b 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2458,6 +2458,15 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge) return dist; } +static bool is_split_edge(const int alignment, const AZEdge edge) +{ + return ((alignment == RGN_ALIGN_BOTTOM) && (edge == AE_TOP_TO_BOTTOMRIGHT)) || + ((alignment == RGN_ALIGN_TOP) && (edge == AE_BOTTOM_TO_TOPLEFT)) || + ((alignment == RGN_ALIGN_LEFT) && (edge == AE_RIGHT_TO_TOPLEFT)) || + ((alignment == RGN_ALIGN_RIGHT) && (edge == AE_LEFT_TO_TOPRIGHT)); + +} + static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event) { sActionzoneData *sad = event->customdata; @@ -2476,7 +2485,16 @@ static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event op->customdata = rmd; rmd->az = az; - rmd->ar = az->ar; + /* special case for region within region - this allows the scale of + * the parent region if the azone edge is not the edge splitting + * both regions */ + if ((az->ar->alignment & RGN_SPLIT_PREV) && az->ar->prev && + !is_split_edge(RGN_ALIGN_ENUM_FROM_MASK(az->ar->alignment), az->edge)) { + rmd->ar = az->ar->prev; + } + else { + rmd->ar = az->ar; + } rmd->sa = sad->sa1; rmd->edge = az->edge; rmd->origx = event->x;