Fix: Zooming certain editors disabled from recent fix
Adjust the logic in `view_zoomstep_apply_ex` to ensure that spaces without the new flag `V2D_ZOOM_IGNORE_KEEPOFS` will still zoom if they do not also have `keepofs` flags set. This means spaces like Geometry Nodes can zoom again.
This commit is contained in:
@@ -751,6 +751,7 @@ static void view_zoomstep_apply_ex(bContext *C,
|
||||
View2D *v2d = ®ion->v2d;
|
||||
const rctf cur_old = v2d->cur;
|
||||
const int snap_test = ED_region_snap_size_test(region);
|
||||
const bool do_keepofs = !(v2d->flag & V2D_ZOOM_IGNORE_KEEPOFS);
|
||||
|
||||
/* calculate amount to move view by, ensuring symmetry so the
|
||||
* old zoom level is restored after zooming back the same amount
|
||||
@@ -767,18 +768,15 @@ static void view_zoomstep_apply_ex(bContext *C,
|
||||
|
||||
/* Only resize view on an axis if change is allowed. */
|
||||
if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
|
||||
/* Only consider keepofs flags if it is not forbidden. */
|
||||
if ((v2d->flag & V2D_ZOOM_IGNORE_KEEPOFS) == 0) {
|
||||
if (v2d->keepofs & V2D_LOCKOFS_X) {
|
||||
v2d->cur.xmax -= 2 * dx;
|
||||
if ((v2d->keepofs & V2D_LOCKOFS_X) && do_keepofs) {
|
||||
v2d->cur.xmax -= 2 * dx;
|
||||
}
|
||||
else if ((v2d->keepofs & V2D_KEEPOFS_X) && do_keepofs) {
|
||||
if (v2d->align & V2D_ALIGN_NO_POS_X) {
|
||||
v2d->cur.xmin += 2 * dx;
|
||||
}
|
||||
else if (v2d->keepofs & V2D_KEEPOFS_X) {
|
||||
if (v2d->align & V2D_ALIGN_NO_POS_X) {
|
||||
v2d->cur.xmin += 2 * dx;
|
||||
}
|
||||
else {
|
||||
v2d->cur.xmax -= 2 * dx;
|
||||
}
|
||||
else {
|
||||
v2d->cur.xmax -= 2 * dx;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -806,17 +804,15 @@ static void view_zoomstep_apply_ex(bContext *C,
|
||||
}
|
||||
}
|
||||
if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0) {
|
||||
if ((v2d->flag & V2D_ZOOM_IGNORE_KEEPOFS) == 0) {
|
||||
if (v2d->keepofs & V2D_LOCKOFS_Y) {
|
||||
v2d->cur.ymax -= 2 * dy;
|
||||
if ((v2d->keepofs & V2D_LOCKOFS_Y) && do_keepofs) {
|
||||
v2d->cur.ymax -= 2 * dy;
|
||||
}
|
||||
else if ((v2d->keepofs & V2D_KEEPOFS_Y) && do_keepofs) {
|
||||
if (v2d->align & V2D_ALIGN_NO_POS_Y) {
|
||||
v2d->cur.ymin += 2 * dy;
|
||||
}
|
||||
else if (v2d->keepofs & V2D_KEEPOFS_Y) {
|
||||
if (v2d->align & V2D_ALIGN_NO_POS_Y) {
|
||||
v2d->cur.ymin += 2 * dy;
|
||||
}
|
||||
else {
|
||||
v2d->cur.ymax -= 2 * dy;
|
||||
}
|
||||
else {
|
||||
v2d->cur.ymax -= 2 * dy;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user