diff options
author | Falk David <falkdavid@gmx.de> | 2020-11-13 00:41:27 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2020-11-13 00:41:27 +0300 |
commit | 76e9d3638f82bd913ced99984e4d052742c2165d (patch) | |
tree | 77c961d77816affb2237ec542a9b852ddcbf25f0 | |
parent | fe808ca8a0931673720ff3999e3c003d83fba685 (diff) |
GPencil: Clean up compiler warnings
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 16 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_select.c | 26 |
2 files changed, 23 insertions, 19 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 373fba35ac0..76317e4db17 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1005,9 +1005,11 @@ static int gpencil_duplicate_exec(bContext *C, wmOperator *op) CTX_DATA_END; } - /* updates */ - DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); - WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); + if (changed) { + /* updates */ + DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); + WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); + } return OPERATOR_FINISHED; } @@ -2846,9 +2848,7 @@ static void gpencil_curve_delete_tagged_points(bGPdata *gpd, bGPDstroke *gps, bGPDstroke *next_stroke, bGPDcurve *gpc, - int tag_flags, - bool select, - int limit) + int tag_flags) { if (gpc == NULL) { return; @@ -2987,7 +2987,7 @@ static int gpencil_delete_selected_points(bContext *C) if (is_curve_edit) { bGPDcurve *gpc = gps->editcurve; gpencil_curve_delete_tagged_points( - gpd, gpf, gps, gps->next, gpc, GP_CURVE_POINT_SELECT, false, 0); + gpd, gpf, gps, gps->next, gpc, GP_CURVE_POINT_SELECT); } else { /* delete unwanted points by splitting stroke into several smaller ones */ @@ -3433,7 +3433,7 @@ static bool gpencil_stroke_points_centroid(Depsgraph *depsgraph, add_v3_v3(r_centroid, fpt); minmax_v3v3_v3(r_min, r_max, fpt); - *count++; + (*count)++; } } diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 29a0d1d07af..ddd8a11d9b5 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -1563,6 +1563,7 @@ typedef bool (*GPencilTestFn)(ARegion *region, const float pt[3], GP_SelectUserData *user_data); +#if 0 static bool gpencil_stroke_fill_isect_rect(ARegion *region, bGPDstroke *gps, const float diff_mat[4][4], @@ -1624,11 +1625,12 @@ static bool gpencil_stroke_fill_isect_rect(ARegion *region, MEM_freeN(points2d); return hit; } +#endif static bool gpencil_generic_curve_select(bContext *C, - Object *ob, + Object *UNUSED(ob), GPencilTestFn is_inside_fn, - rcti box, + rcti UNUSED(box), GP_SelectUserData *user_data, const bool strokemode, const eSelectOp sel_op) @@ -1726,16 +1728,18 @@ static bool gpencil_generic_curve_select(bContext *C, } } - // if (!hit) { - // /* check if we selected the inside of a filled curve */ - // MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1); - // if ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0) { - // continue; - // } - - // whole = gpencil_stroke_fill_isect_rect(region, gps, gps_iter.diff_mat, box); - // } + /* TODO: Fix selection for filled in curves. */ +#if 0 + if (!hit) { + /* check if we selected the inside of a filled curve */ + MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1); + if ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0) { + continue; + } + whole = gpencil_stroke_fill_isect_rect(region, gps, gps_iter.diff_mat, box); + } +#endif /* select the entire curve */ if (strokemode || whole) { const int sel_op_result = ED_select_op_action_deselected(sel_op, any_select, hit || whole); |