Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-09-05 21:18:03 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-09-05 21:19:35 +0300
commitcec67176b117557d797199ab6fd13bba54dba16f (patch)
tree257f29ca4fa2256ab9272ecf98d15894d7fbbfd2
parentd26a0be968e09a89bc0cd49dd08aba3e08a28aad (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.
-rw-r--r--source/blender/blenkernel/intern/gpencil_geom.cc6
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);
}