Cleanup: use switch for Add Object Tool event handling

This commit is contained in:
Campbell Barton 2021-01-30 20:51:18 +11:00
parent 2e84edea97
commit cdf01f7750
1 changed files with 12 additions and 7 deletions

View File

@ -1342,13 +1342,18 @@ static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEve
}
}
}
if (ELEM(event->type, EVT_ESCKEY, RIGHTMOUSE)) {
view3d_interactive_add_exit(C, op);
return OPERATOR_CANCELLED;
}
if (event->type == MOUSEMOVE) {
do_cursor_update = true;
else {
switch (event->type) {
case EVT_ESCKEY:
case RIGHTMOUSE: {
view3d_interactive_add_exit(C, op);
return OPERATOR_CANCELLED;
}
case MOUSEMOVE: {
do_cursor_update = true;
break;
}
}
}
if (ipd->wait_for_input) {