Mask: always add a new spline when adding a new vert

Previously, adding a new vertex with Ctrl-LMB would move an existing
when there was an active spline but no active point.

This function is used as a fallback, extending an existing active point is already handled.
This commit is contained in:
Campbell Barton
2016-04-27 14:09:36 +10:00
parent 32e20369a5
commit ed0db62a3d

View File

@@ -521,26 +521,17 @@ static bool add_vertex_new(const bContext *C, Mask *mask, MaskLayer *masklay, co
const float ctime = CFRA;
MaskSpline *spline;
MaskSplinePoint *point;
MaskSplinePoint *new_point = NULL, *ref_point = NULL;
if (!masklay) {
/* if there's no masklay currently operationg on, create new one */
masklay = BKE_mask_layer_new(mask, "");
mask->masklay_act = mask->masklay_tot - 1;
spline = NULL;
point = NULL;
}
else {
finSelectedSplinePoint(masklay, &spline, &point, true);
}
ED_mask_select_toggle_all(mask, SEL_DESELECT);
if (!spline) {
/* no selected splines in active masklay, create new spline */
spline = BKE_mask_spline_add(masklay);
}
spline = BKE_mask_spline_add(masklay);
masklay->act_spline = spline;
new_point = spline->points;