diff options
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil_curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_curve.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index be14d74de7a..6707fb53aa3 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -781,7 +781,7 @@ void BKE_gpencil_stroke_editcurve_update(bGPdata *gpd, bGPDlayer *gpl, bGPDstrok /** * Sync the selection from stroke to editcurve */ -void BKE_gpencil_editcurve_stroke_sync_selection(bGPDstroke *gps, bGPDcurve *gpc) +void BKE_gpencil_editcurve_stroke_sync_selection(bGPdata *gpd, bGPDstroke *gps, bGPDcurve *gpc) { if (gps->flag & GP_STROKE_SELECT) { gpc->flag |= GP_CURVE_SELECT; @@ -808,10 +808,11 @@ void BKE_gpencil_editcurve_stroke_sync_selection(bGPDstroke *gps, bGPDcurve *gpc /** * Sync the selection from editcurve to stroke */ -void BKE_gpencil_stroke_editcurve_sync_selection(bGPDstroke *gps, bGPDcurve *gpc) +void BKE_gpencil_stroke_editcurve_sync_selection(bGPdata *gpd, bGPDstroke *gps, bGPDcurve *gpc) { if (gpc->flag & GP_CURVE_SELECT) { gps->flag |= GP_STROKE_SELECT; + BKE_gpencil_stroke_select_index_set(gpd, gps, false); for (int i = 0; i < gpc->tot_curve_points - 1; i++) { bGPDcurve_point *gpc_pt = &gpc->curve_points[i]; @@ -865,6 +866,7 @@ void BKE_gpencil_stroke_editcurve_sync_selection(bGPDstroke *gps, bGPDcurve *gpc } else { gps->flag &= ~GP_STROKE_SELECT; + BKE_gpencil_stroke_select_index_set(NULL, gps, true); for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; pt->flag &= ~GP_SPOINT_SELECT; @@ -1089,6 +1091,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps, /* deselect */ pt->flag &= ~GP_SPOINT_SELECT; gps->flag &= ~GP_STROKE_SELECT; + BKE_gpencil_stroke_select_index_set(NULL, gps, true); return; } @@ -1131,6 +1134,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps, pt->flag &= ~GP_SPOINT_SELECT; } gps->flag &= ~GP_STROKE_SELECT; + BKE_gpencil_stroke_select_index_set(NULL, gps, true); /* free temp data */ MEM_freeN(points); @@ -1375,7 +1379,7 @@ void BKE_gpencil_strokes_selected_update_editcurve(bGPdata *gpd) BKE_gpencil_stroke_editcurve_update(gpd, gpl, gps); } /* Update the selection from the stroke to the curve. */ - BKE_gpencil_editcurve_stroke_sync_selection(gps, gps->editcurve); + BKE_gpencil_editcurve_stroke_sync_selection(gpd, gps, gps->editcurve); gps->flag |= GP_STROKE_NEEDS_CURVE_UPDATE; BKE_gpencil_stroke_geometry_update(gpd, gps); @@ -1400,7 +1404,7 @@ void BKE_gpencil_strokes_selected_sync_selection_editcurve(bGPdata *gpd) bGPDcurve *gpc = gps->editcurve; if (gpc != NULL) { /* Update the selection of every stroke that has an editcurve */ - BKE_gpencil_stroke_editcurve_sync_selection(gps, gpc); + BKE_gpencil_stroke_editcurve_sync_selection(gpd, gps, gpc); } } } |