Curve: change rules wrt active bezier
authorCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jul 2015 04:52:01 +0000 (14:52 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jul 2015 04:52:01 +0000 (14:52 +1000)
Activate the vertex even if only a single handle is selected

source/blender/blenkernel/intern/curve.c
source/blender/editors/curve/editcurve.c
source/blender/editors/space_view3d/drawobject.c

index 01e443cdb0d0dbe8836013228b76abc333891eca..d8a7b2d3d0684ca01cec21971306e4a3a81893e1 100644 (file)
@@ -4297,12 +4297,14 @@ void BKE_curve_nurb_vert_active_validate(Curve *cu)
 
        if (BKE_curve_nurb_vert_active_get(cu, &nu, &vert)) {
                if (nu->type == CU_BEZIER) {
-                       if ((((BezTriple *)vert)->f1 & SELECT) == 0) {
+                       BezTriple *bezt = vert;
+                       if (BEZT_ISSEL_ANY(bezt) == 0) {
                                cu->actvert = CU_ACT_NONE;
                        }
                }
                else {
-                       if ((((BPoint *)vert)->f1 & SELECT) == 0) {
+                       BPoint *bp = vert;
+                       if ((bp->f1 & SELECT) == 0) {
                                cu->actvert = CU_ACT_NONE;
                        }
                }
index b468ac3564760a9683185c61577265689eddf69b..bf3dece93d4e3798649e5dc84f7c90a433a4cdbc 100644 (file)
@@ -4185,18 +4185,16 @@ bool mouse_nurb(bContext *C, const int mval[2], bool extend, bool deselect, bool
                        if (bezt) {
                                if (hand == 1) {
                                        select_beztriple(bezt, SELECT, SELECT, HIDDEN);
-                                       BKE_curve_nurb_vert_active_set(cu, nu, bezt);
                                }
                                else {
                                        if (hand == 0) bezt->f1 |= SELECT;
                                        else bezt->f3 |= SELECT;
-
-                                       cu->actvert = CU_ACT_NONE;
                                }
+                               BKE_curve_nurb_vert_active_set(cu, nu, bezt);
                        }
                        else {
-                               BKE_curve_nurb_vert_active_set(cu, nu, bp);
                                select_bpoint(bp, SELECT, SELECT, HIDDEN);
+                               BKE_curve_nurb_vert_active_set(cu, nu, bp);
                        }
                }
                else if (deselect) {
@@ -4254,18 +4252,16 @@ bool mouse_nurb(bContext *C, const int mval[2], bool extend, bool deselect, bool
 
                                if (hand == 1) {
                                        select_beztriple(bezt, SELECT, SELECT, HIDDEN);
-                                       BKE_curve_nurb_vert_active_set(cu, nu, bezt);
                                }
                                else {
                                        if (hand == 0) bezt->f1 |= SELECT;
                                        else bezt->f3 |= SELECT;
-
-                                       cu->actvert = CU_ACT_NONE;
                                }
+                               BKE_curve_nurb_vert_active_set(cu, nu, bezt);
                        }
                        else {
-                               BKE_curve_nurb_vert_active_set(cu, nu, bp);
                                select_bpoint(bp, SELECT, SELECT, HIDDEN);
+                               BKE_curve_nurb_vert_active_set(cu, nu, bp);
                        }
                }
 
index 56de06bedac5c671cf645777ab886c03505a6c40..988d4eb4959901712b5a3b0b8525f0a85a0f4a2b 100644 (file)
@@ -6253,8 +6253,8 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, const
                        if (bezt->hide == 0) {
                                if (sel == 1 && bezt == vert) {
                                        UI_ThemeColor(TH_ACTIVE_VERT);
-                                       bglVertex3fv(bezt->vec[1]);
 
+                                       if (bezt->f2 & SELECT) bglVertex3fv(bezt->vec[1]);
                                        if (!hide_handles) {
                                                if (bezt->f1 & SELECT) bglVertex3fv(bezt->vec[0]);
                                                if (bezt->f3 & SELECT) bglVertex3fv(bezt->vec[2]);