forked from bartvdbraak/blender
Small fix for repeat-last-operator:
- Context in WM wasn't set for regions yet, done now. So repeat works on per-region ops too. - Debug print was printing the wrong repeated op. (repeat-op could show menu naming the op to repeat)
This commit is contained in:
parent
cb92e781f4
commit
2e517db96a
@ -1225,7 +1225,7 @@ static int repeat_last_exec(bContext *C, wmOperator *op)
|
|||||||
wmOperator *lastop= C->wm->operators.last;
|
wmOperator *lastop= C->wm->operators.last;
|
||||||
|
|
||||||
if(lastop) {
|
if(lastop) {
|
||||||
printf("repeat %s\n", op->type->idname);
|
printf("repeat %s\n", lastop->type->idname);
|
||||||
lastop->type->exec(C, lastop);
|
lastop->type->exec(C, lastop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,6 +505,18 @@ static ScrArea *area_event_inside(bContext *C, wmEvent *event)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static ARegion *region_event_inside(bContext *C, wmEvent *event)
|
||||||
|
{
|
||||||
|
ARegion *ar;
|
||||||
|
|
||||||
|
if(C->screen && C->area)
|
||||||
|
for(ar= C->area->regionbase.first; ar; ar= ar->next)
|
||||||
|
if(BLI_in_rcti(&ar->winrct, event->x, event->y))
|
||||||
|
return ar;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* called in main loop */
|
/* called in main loop */
|
||||||
/* goes over entire hierarchy: events -> window -> screen -> area -> region */
|
/* goes over entire hierarchy: events -> window -> screen -> area -> region */
|
||||||
void wm_event_do_handlers(bContext *C)
|
void wm_event_do_handlers(bContext *C)
|
||||||
@ -523,6 +535,7 @@ void wm_event_do_handlers(bContext *C)
|
|||||||
C->window= win;
|
C->window= win;
|
||||||
C->screen= win->screen;
|
C->screen= win->screen;
|
||||||
C->area= area_event_inside(C, event);
|
C->area= area_event_inside(C, event);
|
||||||
|
C->region= region_event_inside(C, event);
|
||||||
|
|
||||||
/* MVC demands to not draw in event handlers... for now we leave it */
|
/* MVC demands to not draw in event handlers... for now we leave it */
|
||||||
wm_window_make_drawable(C, win);
|
wm_window_make_drawable(C, win);
|
||||||
|
Loading…
Reference in New Issue
Block a user