Maksing: fix issue when it's not possible to drag right handle of aligned handles

This commit is contained in:
Sergey Sharybin 2014-03-31 14:46:30 +06:00
parent 6316306cc0
commit f06a1b77e2

@ -503,10 +503,27 @@ static bool slide_point_check_initial_feather(MaskSpline *spline)
} }
static void select_sliding_point(Mask *mask, MaskLayer *mask_layer, MaskSpline *spline, static void select_sliding_point(Mask *mask, MaskLayer *mask_layer, MaskSpline *spline,
MaskSplinePoint *point) MaskSplinePoint *point, eMaskWhichHandle which_handle)
{ {
ED_mask_select_toggle_all(mask, SEL_DESELECT); ED_mask_select_toggle_all(mask, SEL_DESELECT);
switch (which_handle) {
case MASK_WHICH_HANDLE_NONE:
BKE_mask_point_select_set(point, TRUE); BKE_mask_point_select_set(point, TRUE);
break;
case MASK_WHICH_HANDLE_LEFT:
point->bezt.f1 |= SELECT;
break;
case MASK_WHICH_HANDLE_RIGHT:
point->bezt.f3 |= SELECT;
break;
case MASK_WHICH_HANDLE_STICK:
point->bezt.f1 |= SELECT;
point->bezt.f3 |= SELECT;
break;
default:
BLI_assert(!"Unexpected situation in select_sliding_point()");
}
mask_layer->act_spline = spline; mask_layer->act_spline = spline;
mask_layer->act_point = point; mask_layer->act_point = point;
@ -581,7 +598,7 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent *
} }
if (action != SLIDE_ACTION_NONE) { if (action != SLIDE_ACTION_NONE) {
select_sliding_point(mask, masklay, spline, point); select_sliding_point(mask, masklay, spline, point, which_handle);
customdata = MEM_callocN(sizeof(SlidePointData), "mask slide point data"); customdata = MEM_callocN(sizeof(SlidePointData), "mask slide point data");