Fix T44892: Cursor warp, invoked outside the area

If an operator starts outside an area, don't use warping.
(problematic for menu's).
This commit is contained in:
Campbell Barton 2015-06-01 11:59:02 +10:00
parent 4b4695223a
commit b147473f02
Notes: blender-bot 2023-02-14 09:03:55 +01:00
Referenced by issue #44964, Bisect tool
Referenced by issue #44892, Issue when adding new nodes
1 changed files with 2 additions and 2 deletions

View File

@ -1141,7 +1141,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
}
if (wrap) {
rcti *winrect = NULL;
const rcti *winrect = NULL;
ARegion *ar = CTX_wm_region(C);
ScrArea *sa = CTX_wm_area(C);
@ -1150,7 +1150,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event,
{
winrect = &ar->winrct;
}
else if (sa) {
else if (sa && BLI_rcti_isect_pt_v(&sa->totrct, &event->x)) {
winrect = &sa->totrct;
}