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:
-rw-r--r--source/blender/windowmanager/intern/wm_gesture.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c
index a28eedc631e..618d430b4bd 100644
--- a/source/blender/windowmanager/intern/wm_gesture.c
+++ b/source/blender/windowmanager/intern/wm_gesture.c
@@ -26,6 +26,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
+#define _USE_MATH_DEFINES
#include <math.h>
#include "DNA_screen_types.h"
@@ -48,6 +49,7 @@
#include "BIF_gl.h"
#include "BIF_glutil.h"
+
/* context checked on having screen, window and area */
wmGesture *WM_gesture_new(bContext *C, wmEvent *event, int type)
{
@@ -97,7 +99,7 @@ int wm_gesture_evaluate(bContext *C, wmGesture *gesture)
int dx= rect->xmax - rect->xmin;
int dy= rect->ymax - rect->ymin;
if(ABS(dx)+ABS(dy) > TWEAK_THRESHOLD) {
- int theta= (int)round(4.0f*atan2((float)dy, (float)dx)/M_PI);
+ int theta= (int)floor(4.0f*atan2((float)dy, (float)dx)/M_PI + 0.5);
int val= EVT_GESTURE_W;
if(theta==0) val= EVT_GESTURE_E;