Revision: 17556
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17556
Author:   jesterking
Date:     2008-11-24 15:16:04 +0100 (Mon, 24 Nov 2008)

Log Message:
-----------
* make sure this compiles with msvc too.
  - note: there is no round() in msvc math.h, so I used floor(val+0.5)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/windowmanager/intern/wm_gesture.c

Modified: 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_gesture.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_gesture.c    
    2008-11-24 14:15:05 UTC (rev 17555)
+++ 
branches/blender2.5/blender/source/blender/windowmanager/intern/wm_gesture.c    
    2008-11-24 14:16:04 UTC (rev 17556)
@@ -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 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;


_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to