diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-12-15 19:46:59 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-12-15 19:46:59 +0300 |
commit | 0a3902bb5515c4e7ce02fc1a86cc6f2b3868c082 (patch) | |
tree | c327b6b40add0e54db2cd3b6f649be4f2885c39a /source | |
parent | bc64d8dcd852443e387d374a35f57bd9e1c38963 (diff) |
change the cursor bounds to only use the Area if the mouse is outside the region or the region is not a WINDOW type.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 77dfa015d68..03ad58e67d5 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -683,12 +683,22 @@ int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerR } 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; } } |