diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-21 19:22:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-07-21 19:22:11 +0400 |
commit | 44160c97474215d7ed71b2b03bb971889ce4b18e (patch) | |
tree | 5e6bfa696cb118517fcf0179f405bc154fb0823c /source/blender/editors/transform/transform.c | |
parent | ff00aa1b7ea71c44177762a72c23835af16073d2 (diff) |
Fix #20196: division by zero in edge slide with two overlapping loops.
Diffstat (limited to 'source/blender/editors/transform/transform.c')
-rw-r--r-- | source/blender/editors/transform/transform.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index beea3c9bee4..86fdb81e0d9 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4780,10 +4780,11 @@ int doEdgeSlide(TransInfo *t, float perc) //Non prop code look = vertlist; while(look) { - float newlen; + float newlen, edgelen; ev = look->link; tempsv = BLI_ghash_lookup(vertgh,ev); - newlen = (len / len_v3v3(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co)); + edgelen = len_v3v3(editedge_getOtherVert(tempsv->up,ev)->co,editedge_getOtherVert(tempsv->down,ev)->co); + newlen = (edgelen != 0.0f)? (len / edgelen): 0.0f; if(newlen > 1.0) {newlen = 1.0;} if(newlen < 0.0) {newlen = 0.0;} if(flip == 0) { |