From 1afdea624c963b46099d1a5db8d0ebcc48f675c5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 24 Oct 2019 17:54:01 +1100 Subject: Transform: reverse absolute, ratio vertical motion This only impacts push-pull & shrink-fatten. Flipping this matches zoom where moving the mouse cursor up increases the zoom-level. Previous behavior felt unnatural when adding gizmos to these tools. --- source/blender/editors/transform/transform_input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/transform') diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 2821277ffa0..e0c62c45204 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -115,7 +115,8 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const double mval[2 { const int winy = t->ar ? t->ar->winy : 1; - output[0] = ((mval[1] - mi->imval[1]) / winy) * 2.0f; + /* Flip so dragging up increases (matching viewport zoom). */ + output[0] = ((mval[1] - mi->imval[1]) / winy) * -2.0f; } static void InputVerticalAbsolute(TransInfo *t, @@ -128,7 +129,8 @@ static void InputVerticalAbsolute(TransInfo *t, InputVector(t, mi, mval, vec); project_v3_v3v3(vec, vec, t->viewinv[1]); - output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f; + /* Flip so dragging up increases (matching viewport zoom). */ + output[0] = dot_v3v3(t->viewinv[1], vec) * -2.0f; } void setCustomPoints(TransInfo *UNUSED(t), -- cgit v1.2.3