Knife: fix recent drag option /w loop close
authorCampbell Barton <ideasman42@gmail.com>
Sun, 16 Nov 2014 13:56:44 +0000 (14:56 +0100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 16 Nov 2014 13:57:28 +0000 (14:57 +0100)
It would miss adding an edge when closing the loop.

source/blender/editors/mesh/editmesh_knife.c

index 6246abda1258b8bbbc93d1f27e73e2402288d782..b08f7ef9613e3cea371075d4f0d449418d19fe0f 100644 (file)
@@ -3012,12 +3012,22 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                }
                                else {
                                        kcd->is_drag_hold = false;
+
+                                       /* needed because the last face 'hit' is ignored when dragging */
+                                       knifetool_update_mval(kcd, kcd->curr.mval);
                                }
 
                                ED_region_tag_redraw(kcd->ar);
                                break;
                        case KNF_MODAL_ADD_CUT_CLOSED:
                                if (kcd->mode == MODE_DRAGGING) {
+
+                                       /* shouldn't be possible with default key-layout, just incase... */
+                                       if (kcd->is_drag_hold) {
+                                               kcd->is_drag_hold = false;
+                                               knifetool_update_mval(kcd, kcd->curr.mval);
+                                       }
+
                                        kcd->prev = kcd->curr;
                                        kcd->curr = kcd->init;