diff options
Diffstat (limited to 'source/blender/editors/transform/transform_input.c')
-rw-r--r-- | source/blender/editors/transform/transform_input.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 3de68a6e312..a4f03e76fd1 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -189,16 +189,16 @@ void setCustomPoints(TransInfo *UNUSED(t), MouseInput *mi, int start[2], int end static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mval[2], float output[3]) { - float length; - float distance; + double length; + double distance; + double dx, dy; int *data = mi->data; - int dx, dy; if (data) { dx = data[2] - data[0]; dy = data[3] - data[1]; - length = (float)sqrtf(dx*dx + dy*dy); + length = sqrt(dx*dx + dy*dy); if (mi->precision) { /* deal with Shift key by adding motion / 10 to motion before shift press */ @@ -216,7 +216,7 @@ static void InputCustomRatio(TransInfo *UNUSED(t), MouseInput *mi, const int mva distance = (length != 0.0f)? (mdx*dx + mdy*dy) / length: 0.0f; } - output[0] = (length != 0.0f)? distance / length: 0.0f; + output[0] = (float)((length != 0.0f)? distance / length: 0.0f); } } |