From c9a54805a571411f26ab83df838206c237a6c025 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 14 Apr 2007 20:56:24 +0000 Subject: === Transform === Fixed a bug with PET with connectivity, Mesh Face Select mode and Individual Centers. Those three together could give negative factors, which is a big no no (this is due to some approximation in the connectivity code). Clamping the factor makes everything fine. Bug reported by someone on BA --- source/blender/src/transform_generics.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/src/transform_generics.c') diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c index 32aed939161..5df5bd34915 100755 --- a/source/blender/src/transform_generics.c +++ b/source/blender/src/transform_generics.c @@ -830,6 +830,15 @@ void calculatePropRatio(TransInfo *t) /* Use rdist for falloff calculations, it is the real distance */ td->flag &= ~TD_NOACTION; dist= (t->propsize-td->rdist)/t->propsize; + + /* + * Clamp to positive numbers. + * Certain corner cases with connectivity and individual centers + * can give values of rdist larger than propsize. + */ + if (dist < 0.0f) + dist = 0.0f; + switch(G.scene->prop_mode) { case PROP_SHARP: td->factor= dist*dist; -- cgit v1.2.3