diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-09-05 21:18:03 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-09-05 21:19:35 +0300 |
commit | cec67176b117557d797199ab6fd13bba54dba16f (patch) | |
tree | 257f29ca4fa2256ab9272ecf98d15894d7fbbfd2 /source | |
parent | d26a0be968e09a89bc0cd49dd08aba3e08a28aad (diff) |
GPencil: Use correct index for start point and refactor update
The last commit offset the start point by 1.
Also, remove the update because is better to do this in each operator that need it.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_geom.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc index 9f231c8f5f2..7a77bc21c66 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.cc +++ b/source/blender/blenkernel/intern/gpencil_geom.cc @@ -3558,14 +3558,12 @@ void BKE_gpencil_stroke_start_set(bGPdata *gpd, bGPDstroke *gps, int start_idx) } bGPDstroke *gps_b = BKE_gpencil_stroke_duplicate(gps, true, false); - BKE_gpencil_stroke_trim_points(gps_b, 0, start_idx); - BKE_gpencil_stroke_trim_points(gps, start_idx + 1, gps->totpoints - 1); + BKE_gpencil_stroke_trim_points(gps_b, 0, start_idx - 1); + BKE_gpencil_stroke_trim_points(gps, start_idx, gps->totpoints - 1); /* Join both strokes. */ BKE_gpencil_stroke_join(gps, gps_b, false, false, false, false); - BKE_gpencil_stroke_geometry_update(gpd, gps); - BKE_gpencil_free_stroke(gps_b); } |