Fix T65837: Zoom Axis is not working in the Node Editor

It was already fixed for the mouse in
bcda8cc89b, T65837
now the same logic is applied for the track-pad.

Ref D8685
This commit is contained in:
Yevgeny Makarov 2021-01-20 22:11:56 +11:00 committed by Campbell Barton
parent f2988543c2
commit 9425628c84
Notes: blender-bot 2023-02-14 02:11:57 +01:00
Referenced by issue #65837, "Zoom Axis" is not working on the node editor
1 changed files with 12 additions and 0 deletions

View File

@ -1242,6 +1242,18 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *even
}
float dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f;
/* Only respect user setting zoom axis if the view does not have any zoom restrictions
* any will be scaled uniformly. */
if (((v2d->keepzoom & (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y)) == 0) &&
(v2d->keepzoom & V2D_KEEPASPECT)) {
if (U.uiflag & USER_ZOOM_HORIZ) {
dy = 0;
}
else {
dx = 0;
}
}
/* support trackpad zoom to always zoom entirely - the v2d code uses portrait or
* landscape exceptions */
if (v2d->keepzoom & V2D_KEEPASPECT) {