diff options
author | Yevgeny Makarov <jenkm> | 2021-01-20 14:11:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-20 14:56:35 +0300 |
commit | 9425628c84d091591229d54fbb2bc3b36350d94e (patch) | |
tree | 924f940d7721e503c81696154f3a8b0340006bf5 | |
parent | f2988543c27ef69366a01b6be76528d685803eb2 (diff) |
Fix T65837: Zoom Axis is not working in the Node Editor
It was already fixed for the mouse in
bcda8cc89b88c999ff64edcc19973d6289bcbf2a, T65837
now the same logic is applied for the track-pad.
Ref D8685
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 222f03ee1d8..8ce22387eb2 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -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) { |