[Bf-blender-cvs] [2d1fe736fab] master: Fix T96238: shrinking to zero doesn't actually scales the radius to zero

Germano Cavalcante noreply at git.blender.org
Tue Jul 12 15:20:09 CEST 2022


Commit: 2d1fe736fabdcccdd46edfbdfc68720498c30e10
Author: Germano Cavalcante
Date:   Tue Jul 12 10:11:05 2022 -0300
Branches: master
https://developer.blender.org/rB2d1fe736fabdcccdd46edfbdfc68720498c30e10

Fix T96238: shrinking to zero doesn't actually scales the radius to zero

Probably to prevent the radius of a point from being stuck at zero,
the `Shrink/Fatten` curve operator sets a minimum value of `0.001`
for all points being transformed.

This is an inconvenience as these points may have been purposely set
to zero on the panel.

And it also doesn't follow the convention seen in other operators
(which keep the value zero).

So remove this limitation.

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

M	source/blender/editors/transform/transform_mode_curveshrinkfatten.c

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

diff --git a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c
index aa4d608de04..7b65417d32b 100644
--- a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c
+++ b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c
@@ -65,9 +65,7 @@ static void applyCurveShrinkFatten(TransInfo *t, const int UNUSED(mval[2]))
         *td->val = td->ival * ratio;
         /* apply PET */
         *td->val = (*td->val * td->factor) + ((1.0f - td->factor) * td->ival);
-        if (*td->val <= 0.0f) {
-          *td->val = 0.001f;
-        }
+        CLAMP_MIN(*td->val, 0.0f);
       }
     }
   }
@@ -93,10 +91,6 @@ void initCurveShrinkFatten(TransInfo *t)
   t->num.unit_sys = t->scene->unit.system;
   t->num.unit_type[0] = B_UNIT_NONE;
 
-#ifdef USE_NUM_NO_ZERO
-  t->num.val_flag[0] |= NUM_NO_ZERO;
-#endif
-
   t->flag |= T_NO_CONSTRAINT;
 }



More information about the Bf-blender-cvs mailing list