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_input.c | |
parent | ff00aa1b7ea71c44177762a72c23835af16073d2 (diff) |
Fix #20196: division by zero in edge slide with two overlapping loops.
Diffstat (limited to 'source/blender/editors/transform/transform_input.c')
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index d7ebd28f604..b7cb34802cc 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -197,17 +197,17 @@ void InputCustomRatio(TransInfo *t, MouseInput *mi, short mval[2], float output[ mdx = (mi->precision_mval[0] + (float)(mval[0] - mi->precision_mval[0]) / 10.0f) - data[2]; mdy = (mi->precision_mval[1] + (float)(mval[1] - mi->precision_mval[1]) / 10.0f) - data[3]; - distance = (mdx*dx + mdy*dy) / length; + distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f; } else { short mdx, mdy; mdx = mval[0] - data[2]; mdy = mval[1] - data[3]; - distance = (mdx*dx + mdy*dy) / length; + distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f; } - output[0] = distance / length; + output[0] = (length != 0.0f)? distance / length: 0.0f; } } |