diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-02-20 12:16:51 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-02-20 12:16:59 +0300 |
commit | 173b6b792cf95fb9eb20ec760b28469d46b0ff52 (patch) | |
tree | d1ae9e54c06d3972e7bba5fe2c667a35a51fbf29 /source/blender/editors/gpencil/gpencil_edit.c | |
parent | 37e6a1995ac7eeabd5b6a56621ad5a850dae4149 (diff) |
Cleanup: Split grease pencil selection index functions
This makes the code more readable.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index aec593b97ea..b03d2c6e795 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -992,7 +992,7 @@ static int gpencil_duplicate_exec(bContext *C, wmOperator *op) pt->flag &= ~GP_SPOINT_SELECT; } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); changed = true; } @@ -1194,7 +1194,7 @@ static void gpencil_add_move_points(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gp /* if the stroke is not reused, deselect */ if (!do_stroke) { gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } @@ -1711,7 +1711,7 @@ static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op) } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } CTX_DATA_END; @@ -2551,7 +2551,7 @@ static bool gpencil_dissolve_selected_stroke_points(bContext *C, /* deselect the stroke, since none of its selected points will still be selected */ 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++) { pt->flag &= ~GP_SPOINT_SELECT; } @@ -2624,7 +2624,7 @@ static int gpencil_delete_selected_points(bContext *C) if (gps->flag & GP_STROKE_SELECT) { /* deselect old stroke, since it will be used as template for the new strokes */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); if (is_curve_edit) { bGPDcurve *gpc = gps->editcurve; @@ -4579,7 +4579,7 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op) else if (mode == GP_SEPARATE_STROKE) { /* deselect old stroke */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); /* unlink from source frame */ BLI_remlink(&gpf->strokes, gps); gps->prev = gps->next = NULL; @@ -4988,7 +4988,7 @@ static int gpencil_cutter_lasso_select(bContext *C, } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } CTX_DATA_END; @@ -5029,7 +5029,7 @@ static int gpencil_cutter_lasso_select(bContext *C, changed = true; pt->flag |= GP_SPOINT_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); float r_hita[3], r_hitb[3]; if (gps->totpoints > 1) { ED_gpencil_select_stroke_segment( |