[Bf-blender-cvs] [9848367] master: Fix typo in calculateCenterMedian that could give computed median point wrong values.

Grigory Revzin noreply at git.blender.org
Sun Oct 19 20:23:25 CEST 2014


Commit: 984836781e8f419d16681a2da1946fde9032e4f6
Author: Grigory Revzin
Date:   Sun Oct 19 20:13:05 2014 +0200
Branches: master
https://developer.blender.org/rB984836781e8f419d16681a2da1946fde9032e4f6

Fix typo in calculateCenterMedian that could give computed median point wrong values.

>From soc-2014-shapekey branch, with minor edits by mont29 (Bastien Montagne).

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

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

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

diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 24dc6f6..b02671e 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1651,8 +1651,9 @@ void calculateCenterMedian(TransInfo *t, float r_center[3])
 			}
 		}
 	}
-	if (i)
-		mul_v3_fl(partial, 1.0f / total);
+	if (total) {
+		mul_v3_fl(partial, 1.0f / (float)total);
+	}
 	copy_v3_v3(r_center, partial);
 }




More information about the Bf-blender-cvs mailing list