[Bf-blender-cvs] [bafe22e8cea] master: Fix T79112: Redo shrink/fatten uses negative values

Campbell Barton noreply at git.blender.org
Tue Jul 21 13:38:42 CEST 2020


Commit: bafe22e8cea78991e3f8e4e435985f9a27a1587f
Author: Campbell Barton
Date:   Tue Jul 21 21:34:08 2020 +1000
Branches: master
https://developer.blender.org/rBbafe22e8cea78991e3f8e4e435985f9a27a1587f

Fix T79112: Redo shrink/fatten uses negative values

The numbers in the redo panel were negated compared to the value
entered while transforming.

===================================================================

M	source/blender/editors/transform/transform_input.c
M	source/blender/editors/transform/transform_mode_shrink_fatten.c

===================================================================

diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index 078020e932e..9c8d99d0d24 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -124,8 +124,8 @@ static void InputVerticalRatio(TransInfo *t, MouseInput *mi, const double mval[2
 {
   const int winy = t->region ? t->region->winy : 1;
 
-  /* Flip so dragging up increases (matching viewport zoom). */
-  output[0] = ((mval[1] - mi->imval[1]) / winy) * -2.0f;
+  /* Dragging up increases (matching viewport zoom). */
+  output[0] = ((mval[1] - mi->imval[1]) / winy) * 2.0f;
 }
 
 /** Callback for #INPUT_VERTICAL_ABSOLUTE */
@@ -139,8 +139,8 @@ static void InputVerticalAbsolute(TransInfo *t,
   InputVector(t, mi, mval, vec);
   project_v3_v3v3(vec, vec, t->viewinv[1]);
 
-  /* Flip so dragging up increases (matching viewport zoom). */
-  output[0] = dot_v3v3(t->viewinv[1], vec) * -2.0f;
+  /* Dragging up increases (matching viewport zoom). */
+  output[0] = dot_v3v3(t->viewinv[1], vec) * 2.0f;
 }
 
 /** Callback for #INPUT_CUSTOM_RATIO_FLIP */
diff --git a/source/blender/editors/transform/transform_mode_shrink_fatten.c b/source/blender/editors/transform/transform_mode_shrink_fatten.c
index 78d3efa0d69..6302bc96330 100644
--- a/source/blender/editors/transform/transform_mode_shrink_fatten.c
+++ b/source/blender/editors/transform/transform_mode_shrink_fatten.c
@@ -54,13 +54,13 @@ static void applyShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
   char str[UI_MAX_DRAW_STR];
   size_t ofs = 0;
 
-  distance = -t->values[0];
+  distance = t->values[0];
 
   snapGridIncrement(t, &distance);
 
   applyNumInput(&t->num, &distance);
 
-  t->values_final[0] = -distance;
+  t->values_final[0] = distance;
 
   /* header print for NumInput */
   ofs += BLI_strncpy_rlen(str + ofs, TIP_("Shrink/Fatten:"), sizeof(str) - ofs);



More information about the Bf-blender-cvs mailing list