Fix resizing asset shelf header edge not working without region overlap

If region overlap was disabled, the full background of the asset shelf
header would be drawn, unlike usually where we keep the space between
button sections transparent. But resizing the region by dragging wasn't
possible from the space between the button sections, even though the
header was fully opaque.

Button section drawing should only be respected when region overlap is
enabled.
This commit is contained in:
Julian Eisel
2023-10-30 18:13:17 +01:00
parent 9b2deb37a0
commit 2e1244f3cf

View File

@@ -850,11 +850,11 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b
const ARegion *region = az->region;
const int local_xy[2] = {xy[0] - region->winrct.xmin, xy[1] - region->winrct.ymin};
/* Respect button sections: If the mouse is horizontally hovering empty space defined by a
* separator-spacer between buttons, don't allow scaling the region from there. Used for
* regions that have a transparent background between such button sections, users don't
* expect to be able to resize from there. */
if (region->visible && (region->flag & RGN_FLAG_RESIZE_RESPECT_BUTTON_SECTIONS) &&
/* Respect button sections: Clusters of buttons (separated using separator-spacers) are
* drawn with a background, in-between them the region is fully transparent (if "Region
* Overlap" is enabled). Only allow dragging visible edges, so at the button sections. */
if (region->visible && region->overlap &&
(region->flag & RGN_FLAG_RESIZE_RESPECT_BUTTON_SECTIONS) &&
!UI_region_button_sections_is_inside_x(az->region, local_xy[0]))
{
az = nullptr;