Revision: 33690
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33690
Author:   campbellbarton
Date:     2010-12-15 17:46:59 +0100 (Wed, 15 Dec 2010)

Log Message:
-----------
change the cursor bounds to only use the Area if the mouse is outside the 
region or the region is not a WINDOW type.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 
2010-12-15 16:15:52 UTC (rev 33689)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 
2010-12-15 16:46:59 UTC (rev 33690)
@@ -683,13 +683,23 @@
                                }
 
                                if(wrap) {
+                                       rcti *winrect= NULL;
+                                       ARegion *ar= CTX_wm_region(C);
                                        ScrArea *sa= CTX_wm_area(C);
-                                       if(sa) {
-                                               bounds[0]= sa->totrct.xmin;
-                                               bounds[1]= sa->totrct.ymax;
-                                               bounds[2]= sa->totrct.xmax;
-                                               bounds[3]= sa->totrct.ymin;
+
+                                       if(ar && ar->regiontype == 
RGN_TYPE_WINDOW && BLI_in_rcti(&ar->winrct, event->x, event->y)) {
+                                               winrect= &ar->winrct;
                                        }
+                                       else if(sa) {
+                                               winrect= &sa->totrct;
+                                       }
+
+                                       if(winrect) {
+                                               bounds[0]= winrect->xmin;
+                                               bounds[1]= winrect->ymax;
+                                               bounds[2]= winrect->xmax;
+                                               bounds[3]= winrect->ymin;
+                                       }
                                }
 
                                WM_cursor_grab(CTX_wm_window(C), wrap, FALSE, 
bounds);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to