Fix #148030: Right Side Corner Zone Width Change

With #144591 it was not my intent to increase the width of the right-
side corner action zones when visible "Corner Handles" are enabled. It
is only the left side that gains the icon so making the right side
wider only interferes with other content. This PR just fixes this by
defining different widths for right versus left zones.

Pull Request: https://projects.blender.org/blender/blender/pulls/148076
This commit is contained in:
Harley Acheson
2025-10-14 19:58:04 +02:00
committed by Harley Acheson
parent 8d1688383e
commit 8b726ad83d
5 changed files with 11 additions and 10 deletions

View File

@@ -2213,8 +2213,9 @@ void UI_update_text_styles();
#define UI_HEADER_OFFSET \
((void)0, ((U.uiflag & USER_AREA_CORNER_HANDLE) ? 16.0f : 8.0f) * UI_SCALE_FAC)
#define UI_AZONESPOTW UI_HEADER_OFFSET /* Width of corner action zone #AZone. */
#define UI_AZONESPOTH (0.6f * U.widget_unit) /* Height of corner action zone #AZone. */
#define UI_AZONESPOTW_LEFT UI_HEADER_OFFSET /* Width of left-side corner #AZone. */
#define UI_AZONESPOTW_RIGHT (8.0f * UI_SCALE_FAC) /* Width of right-side corner #AZone. */
#define UI_AZONESPOTH (0.6f * U.widget_unit) /* Height of corner action zone #AZone. */
/* uiLayoutOperatorButs flags */
enum {

View File

@@ -338,7 +338,7 @@ static void ui_update_flexible_spacing(const ARegion *region, uiBlock *block)
for (const std::unique_ptr<uiBut> &but : block->buttons) {
if (but->type == ButType::SeprSpacer) {
ui_but_to_pixelrect(&rect, region, block, but.get());
spacers_pos.append(rect.xmax + UI_HEADER_OFFSET);
spacers_pos.append(rect.xmax + int(8.0f * UI_SCALE_FAC));
}
}

View File

@@ -191,8 +191,8 @@ static void view2d_masks(View2D *v2d, const rcti *mask_scroll)
/* Adjust horizontal scroller to avoid interfering with splitter areas. */
if (scroll & V2D_SCROLL_HORIZONTAL) {
v2d->hor.xmin += UI_AZONESPOTW;
v2d->hor.xmax -= UI_AZONESPOTW;
v2d->hor.xmin += UI_AZONESPOTW_LEFT;
v2d->hor.xmax -= UI_AZONESPOTW_RIGHT;
}
/* Adjust vertical scroller to avoid horizontal scrollers and splitter areas. */

View File

@@ -1061,20 +1061,20 @@ static void area_azone_init(const wmWindow *win, const bScreen *screen, ScrArea
/* Bottom-left. */
{area->totrct.xmin - U.pixelsize,
area->totrct.ymin - U.pixelsize,
area->totrct.xmin + UI_HEADER_OFFSET,
area->totrct.xmin + UI_AZONESPOTW_LEFT,
float(area->totrct.ymin + ED_area_headersize())},
/* Bottom-right. */
{area->totrct.xmax - UI_AZONESPOTW,
{area->totrct.xmax - UI_AZONESPOTW_RIGHT,
area->totrct.ymin - U.pixelsize,
area->totrct.xmax + U.pixelsize,
area->totrct.ymin + UI_AZONESPOTH},
/* Top-left. */
{area->totrct.xmin - U.pixelsize,
float(area->totrct.ymax - ED_area_headersize()),
area->totrct.xmin + UI_HEADER_OFFSET,
area->totrct.xmin + UI_AZONESPOTW_LEFT,
area->totrct.ymax + U.pixelsize},
/* Top-right. */
{area->totrct.xmax - UI_AZONESPOTW,
{area->totrct.xmax - UI_AZONESPOTW_RIGHT,
area->totrct.ymax - UI_AZONESPOTH,
area->totrct.xmax + U.pixelsize,
area->totrct.ymax + U.pixelsize},

View File

@@ -945,7 +945,7 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b
}
else {
const int mouse_sq = square_i(xy[0] - az->x2) + square_i(xy[1] - az->y2);
const int spot_sq = square_i(UI_AZONESPOTW);
const int spot_sq = square_i(UI_AZONESPOTW_RIGHT);
const int fadein_sq = square_i(AZONEFADEIN);
const int fadeout_sq = square_i(AZONEFADEOUT);