Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2007-04-15 00:56:24 +0400
committerMartin Poirier <theeth@yahoo.com>2007-04-15 00:56:24 +0400
commitc9a54805a571411f26ab83df838206c237a6c025 (patch)
tree52dbe8ad00afaae9bd9e7bc396ad896403f6ce6f /source/blender/src/transform_generics.c
parent16be2ce5ba2baf8c65042716f7589cbfaf02a6d6 (diff)
=== 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
Diffstat (limited to 'source/blender/src/transform_generics.c')
-rwxr-xr-xsource/blender/src/transform_generics.c9
1 files changed, 9 insertions, 0 deletions
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;