diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-09-14 15:41:22 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-09-14 15:42:15 +0300 |
commit | 4b14f763da0e207bb561a40aefc5473ff0c5b184 (patch) | |
tree | 12329e6ec89e54f01cf0912c3eaeb0ce967b3044 | |
parent | d9e2adaaf98cd558f6de26df22928ba86f5b9f85 (diff) |
Fix 'Links Cut' adding undo steps without cutting anything
The operator's return was ignored by the gesture ops that always
returned `OPERATOR_FINISHED`.
This ends by adding a undo step that brings no change.
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture_ops.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.c b/source/blender/windowmanager/intern/wm_gesture_ops.c index 74a94e997e0..a38cbb920c4 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.c +++ b/source/blender/windowmanager/intern/wm_gesture_ops.c @@ -618,8 +618,9 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_RUNNING_MODAL; } -static void gesture_lasso_apply(bContext *C, wmOperator *op) +static int gesture_lasso_apply(bContext *C, wmOperator *op) { + int retval = OPERATOR_FINISHED; wmGesture *gesture = op->customdata; PointerRNA itemptr; float loc[2]; @@ -639,9 +640,11 @@ static void gesture_lasso_apply(bContext *C, wmOperator *op) gesture_modal_end(C, op); if (op->type->exec) { - int retval = op->type->exec(C, op); + retval = op->type->exec(C, op); OPERATOR_RETVAL_CHECK(retval); } + + return retval; } int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event) @@ -683,8 +686,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event) case MIDDLEMOUSE: case RIGHTMOUSE: if (event->val == KM_RELEASE) { /* key release */ - gesture_lasso_apply(C, op); - return OPERATOR_FINISHED; + return gesture_lasso_apply(C, op); } break; case EVT_ESCKEY: |