From c063e01f068fa6a02891238f9e73f9e3f952919a Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Thu, 28 Dec 2006 03:11:21 +0000 Subject: [PATCH] === Bug Fix === Fix for bug [ #5522 ] inaccurate rotation Entering very high/low values using numeric input in a rotation (+/- 360000 and more/less) resulted in incorrect rotations. Fixed by clamping the actual rotation between -180 and 180 before converting to radians (just to be clear, the clamping already happened and is inevitable, now, it just happens earlier). --- source/blender/src/transform.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index facee8ed8d9..5a6f68a31e8 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -1912,6 +1912,13 @@ int Rotation(TransInfo *t, short mval[2]) sprintf(str, "Rot: %s %s", &c[0], t->proptext); + /* Clamp between -180 and 180 */ + while (final >= 180.0) + final -= 360.0; + + while (final <= -180.0) + final += 360.0; + final *= (float)(M_PI / 180.0); } else {