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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-07-21 23:12:18 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-07-21 23:12:18 +0400
commit8cdb241be0f5b7ac94223d062993c889262c6bce (patch)
tree8d4798d7244e680abfbf493abcb37a1e892dfd1b /source/blender/editors/transform/transform_input.c
parent930f2fa89848c60efd2a2083bad36ff7c98369dd (diff)
parent969c0fd718ed500fedfdeb1b4a5c0026febdb975 (diff)
Merged changes in the trunk up to revision 30594.
Diffstat (limited to 'source/blender/editors/transform/transform_input.c')
-rw-r--r--source/blender/editors/transform/transform_input.c6
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;
}
}