Commit: a0915d3ba6ba33a3f5162816f0291ea4b947f5c5
Author: Dilith Jayakody
Date:   Mon Jan 17 22:55:47 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rBa0915d3ba6ba33a3f5162816f0291ea4b947f5c5

Fixed new point wrong handle being dragged

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

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 d1bd61d6d1f..644d8d0b247 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -234,8 +234,8 @@ static void move_new_bezt_handles_to_mouse(const wmEvent 
*event,
     bezt->h2 = HD_ALIGN;
   }
 
-  const bool is_endpoint = (nu->bezt + nu->pntsu - 1 == bezt && !(nu->flagu & 
CU_NURB_CYCLIC)) ||
-                           (nu->bezt == bezt && (nu->flagu & CU_NURB_CYCLIC));
+  const bool is_last_point = nu->pntsu > 1 && nu->bezt + nu->pntsu - 1 == bezt 
&&
+                             !(nu->flagu & CU_NURB_CYCLIC);
 
   float bezt_loc[2];
   worldspace_to_screenspace(bezt->vec[1], vc, bezt_loc);
@@ -245,7 +245,7 @@ static void move_new_bezt_handles_to_mouse(const wmEvent 
*event,
   screenspace_to_worldspace(bezt_loc, bezt->vec[1], vc, location);
 
   /* If the new point is the last point of the curve, move the second handle 
to the mouse. */
-  if (is_endpoint) {
+  if (is_last_point) {
 
     copy_v3_v3(bezt->vec[2], location);

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to