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>2011-12-26 23:03:32 +0400
committerMartin Poirier <theeth@yahoo.com>2011-12-26 23:03:32 +0400
commitd8ab99c147b864bf66347a57b383b7cf0b01fd6b (patch)
treebf6015d7299307df9dc04e1e98433478b4a3aeaa /source/blender/editors/transform
parent70329296d44b9ce781447e4d4280a223e17a7df2 (diff)
[#29611] Crash when scale one vertex with snap.
Reported by Andrey Penyaz Scale snap defaults to 1 when snapping is impossible (distance to center of transformation is zero).
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform_snap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 46792457f63..d341a21bc71 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -680,7 +680,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3])
static float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
{
- float d1[3], d2[3], center[3];
+ float d1[3], d2[3], center[3], len_d1;
copy_v3_v3(center, t->center);
if(t->flag & (T_EDIT|T_POSE)) {
@@ -696,7 +696,9 @@ static float ResizeBetween(TransInfo *t, float p1[3], float p2[3])
mul_m3_v3(t->con.pmtx, d2);
}
- return len_v3(d2) / len_v3(d1);
+ len_d1 = len_v3(d1);
+
+ return len_d1 != 0.0f ? len_v3(d2) / len_d1 : 1;
}
/********************** CALC **************************/