Fix snap to grid not taking the current grid resolution into

account in quad split 3d view. Now WM_OP_EXEC/INVOKE_REGION_WIN
context stays in the current region if it is already a region
of type window, so the operator gets executed in the right context.
This commit is contained in:
Brecht Van Lommel 2010-01-31 16:59:21 +00:00
parent 127b3e6882
commit 8d513efdb0
2 changed files with 8 additions and 6 deletions

@ -594,11 +594,12 @@ static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int contex
case WM_OP_EXEC_REGION_WIN:
case WM_OP_INVOKE_REGION_WIN:
{
/* forces operator to go to the region window, for header menus */
/* forces operator to go to the region window, for header menus
but we stay in the same region if we are already in one */
ARegion *ar= CTX_wm_region(C);
ScrArea *area= CTX_wm_area(C);
if(area) {
if(!(ar && ar->regiontype == RGN_TYPE_WINDOW) && area) {
ARegion *ar1= area->regionbase.first;
for(; ar1; ar1= ar1->next)
if(ar1->regiontype==RGN_TYPE_WINDOW)

@ -475,10 +475,11 @@ static wmKeyMapItem *wm_keymap_item_find_props(const bContext *C, const char *op
if(found==NULL) {
if(ELEM(opcontext, WM_OP_EXEC_REGION_WIN, WM_OP_INVOKE_REGION_WIN)) {
if(sa) {
ARegion *ar= sa->regionbase.first;
for(; ar; ar= ar->next)
if(ar->regiontype==RGN_TYPE_WINDOW)
break;
if(!(ar && ar->regiontype == RGN_TYPE_WINDOW)) {
for(ar= sa->regionbase.first; ar; ar= ar->next)
if(ar->regiontype==RGN_TYPE_WINDOW)
break;
}
if(ar)
found= wm_keymap_item_find_handlers(C, &ar->handlers, opname, opcontext, properties, hotkey, compare_props, keymap_r);