From 9425628c84d091591229d54fbb2bc3b36350d94e Mon Sep 17 00:00:00 2001 From: Yevgeny Makarov Date: Wed, 20 Jan 2021 22:11:56 +1100 Subject: [PATCH] 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 --- source/blender/editors/interface/view2d_ops.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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) {