diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-15 06:00:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-15 06:40:40 +0400 |
commit | b8b412230b1e1ed43295d5c299477a2cba73355e (patch) | |
tree | 0b3d61142c7a0490293c975a636165057f20c58e /source/blender/windowmanager | |
parent | e5c7535bebc37e04489fac4e88beca8cc5677d7d (diff) |
Code Cleanup: use iroundf
also increase precision of rctf print functions
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 33758d9699d..83cb6fd83d1 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -136,8 +136,8 @@ int wm_gesture_evaluate(wmGesture *gesture) rcti *rect = gesture->customdata; int dx = BLI_rcti_size_x(rect); int dy = BLI_rcti_size_y(rect); - if (ABS(dx) + ABS(dy) > U.tweak_threshold) { - int theta = (int)floor(4.0f * atan2f((float)dy, (float)dx) / (float)M_PI + 0.5f); + if (abs(dx) + abs(dy) > U.tweak_threshold) { + int theta = iroundf(4.0f * atan2f((float)dy, (float)dx) / (float)M_PI); int val = EVT_GESTURE_W; if (theta == 0) val = EVT_GESTURE_E; |