[Bf-blender-cvs] [2bd457b4219] soc-2021-curves: Reverted to cut/delete on press due to bad feel

dilithjay noreply at git.blender.org
Thu Jun 24 20:28:22 CEST 2021


Commit: 2bd457b42198a591eac53c0cd1f3c78572be989d
Author: dilithjay
Date:   Thu Jun 24 23:38:46 2021 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB2bd457b42198a591eac53c0cd1f3c78572be989d

Reverted to cut/delete on press due to bad feel

===================================================================

M	source/blender/editors/curve/editcurve_pen.c

===================================================================

diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c
index f51576634f9..0065badcca3 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -616,43 +616,6 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event)
   }
   else if (ELEM(event->type, LEFTMOUSE)) {
     if (event->val == KM_PRESS) {
-      retval = ED_curve_editnurb_select_pick(C, event->mval, extend, deselect, toggle);
-      RNA_boolean_set(op->ptr, "new", !retval);
-
-      /* Check if point underneath mouse. Get point if any. */
-      if (!cut_or_delete && !retval) {
-
-        /* Create new point under the mouse cursor. Set handle types as vector.
-        If an end point of a spline is selected, set the new point as the
-        new end point of the spline. */
-        float location[3];
-
-        ED_curve_nurb_vert_selected_find(cu, vc.v3d, &nu, &bezt, &bp);
-
-        if (bezt) {
-          mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
-        }
-        else if (bp) {
-          mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
-        }
-        else {
-          copy_v3_v3(location, vc.scene->cursor.location);
-        }
-
-        ED_view3d_win_to_3d_int(vc.v3d, vc.region, location, event->mval, location);
-        EditNurb *editnurb = cu->editnurb;
-        ed_editcurve_addvert(cu, editnurb, vc.v3d, location);
-        ED_curve_nurb_vert_selected_find(cu, vc.v3d, &nu, &bezt, &bp);
-        if (bezt) {
-          bezt->h1 = HD_VECT;
-          bezt->h2 = HD_VECT;
-        }
-      }
-    }
-    if (event->val == KM_RELEASE) {
-      if (dragging) {
-        RNA_boolean_set(op->ptr, "dragging", false);
-      }
       bool found_point = false;
 
       if (cut_or_delete) {
@@ -726,6 +689,46 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event)
           BKE_nurb_handles_calc(nu);
         }
       }
+      else {
+        retval = ED_curve_editnurb_select_pick(C, event->mval, extend, deselect, toggle);
+        RNA_boolean_set(op->ptr, "new", !retval);
+
+        /* Check if point underneath mouse. Get point if any. */
+        if (!retval) {
+
+          /* Create new point under the mouse cursor. Set handle types as vector.
+          If an end point of a spline is selected, set the new point as the
+          new end point of the spline. */
+          float location[3];
+
+          ED_curve_nurb_vert_selected_find(cu, vc.v3d, &nu, &bezt, &bp);
+
+          if (bezt) {
+            mul_v3_m4v3(location, vc.obedit->obmat, bezt->vec[1]);
+          }
+          else if (bp) {
+            mul_v3_m4v3(location, vc.obedit->obmat, bp->vec);
+          }
+          else {
+            copy_v3_v3(location, vc.scene->cursor.location);
+          }
+
+          ED_view3d_win_to_3d_int(vc.v3d, vc.region, location, event->mval, location);
+          EditNurb *editnurb = cu->editnurb;
+          ed_editcurve_addvert(cu, editnurb, vc.v3d, location);
+          ED_curve_nurb_vert_selected_find(cu, vc.v3d, &nu, &bezt, &bp);
+          if (bezt) {
+            bezt->h1 = HD_VECT;
+            bezt->h2 = HD_VECT;
+          }
+        }
+      }
+    }
+    if (event->val == KM_RELEASE) {
+      if (dragging) {
+        RNA_boolean_set(op->ptr, "dragging", false);
+      }
+
       RNA_boolean_set(op->ptr, "new", false);
       ret = OPERATOR_FINISHED;
     }



More information about the Bf-blender-cvs mailing list