[Bf-blender-cvs] [9881c851239] soc-2021-curves: Fixed - Invisible handles selectable

Dilith Jayakody noreply at git.blender.org
Mon Jan 17 18:58:35 CET 2022


Commit: 9881c85123983d57f521997be4853dbbdd863c62
Author: Dilith Jayakody
Date:   Mon Jan 17 23:12:42 2022 +0530
Branches: soc-2021-curves
https://developer.blender.org/rB9881c85123983d57f521997be4853dbbdd863c62

Fixed - Invisible handles selectable

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

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 644d8d0b247..1e4fecca525 100644
--- a/source/blender/editors/curve/editcurve_pen.c
+++ b/source/blender/editors/curve/editcurve_pen.c
@@ -578,7 +578,13 @@ static bool get_closest_vertex_to_point_in_nurbs(const ListBase *nurbs,
       for (int i = 0; i < nu->pntsu; i++) {
         BezTriple *bezt = &nu->bezt[i];
         float bezt_vec[2];
-        for (short j = 0; j < 3; j++) {
+        int start = 0, end = 3;
+        int handle_display = vc->v3d->overlay.handle_display;
+        if (handle_display == CURVE_HANDLE_NONE ||
+            (handle_display == CURVE_HANDLE_SELECTED && !BEZT_ISSEL_IDX(bezt, 1))) {
+          start = 1, end = 2;
+        }
+        for (short j = start; j < end; j++) {
           if (worldspace_to_screenspace(bezt->vec[j], vc, bezt_vec)) {
             const float distance = len_manhattan_v2v2(bezt_vec, point);
             if (distance < min_distance_bezt) {



More information about the Bf-blender-cvs mailing list