diff options
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 4167f60e880..28477e9dc30 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1148,7 +1148,7 @@ void BKE_gpencil_stroke_sync_selection(bGPdata *gpd, bGPDstroke *gps) * so initially, we must deselect */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { if (pt->flag & GP_SPOINT_SELECT) { @@ -1158,7 +1158,7 @@ void BKE_gpencil_stroke_sync_selection(bGPdata *gpd, bGPDstroke *gps) } if (gps->flag & GP_STROKE_SELECT) { - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } } @@ -1170,7 +1170,7 @@ void BKE_gpencil_curve_sync_selection(bGPdata *gpd, bGPDstroke *gps) } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); gpc->flag &= ~GP_CURVE_SELECT; bool is_selected = false; @@ -1193,20 +1193,21 @@ void BKE_gpencil_curve_sync_selection(bGPdata *gpd, bGPDstroke *gps) if (is_selected) { gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } } /* Assign unique stroke ID for selection. */ -void BKE_gpencil_stroke_select_index_set(bGPdata *gpd, bGPDstroke *gps, const bool reset) +void BKE_gpencil_stroke_select_index_set(bGPdata *gpd, bGPDstroke *gps) { - if (!reset) { - gpd->select_last_index++; - gps->select_index = gpd->select_last_index; - } - else { - gps->select_index = 0; - } + gpd->select_last_index++; + gps->select_index = gpd->select_last_index; +} + +/* Reset unique stroke ID for selection. */ +void BKE_gpencil_stroke_select_index_reset(bGPDstroke *gps) +{ + gps->select_index = 0; } /* ************************************************** */ @@ -2533,7 +2534,7 @@ bool BKE_gpencil_from_image( } if (gps->flag & GP_STROKE_SELECT) { - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } BKE_gpencil_stroke_geometry_update(gpd, gps); |