[Bf-blender-cvs] [cec67176b11] master: GPencil: Use correct index for start point and refactor update

Antonio Vazquez noreply at git.blender.org
Mon Sep 5 20:19:46 CEST 2022


Commit: cec67176b117557d797199ab6fd13bba54dba16f
Author: Antonio Vazquez
Date:   Mon Sep 5 20:18:03 2022 +0200
Branches: master
https://developer.blender.org/rBcec67176b117557d797199ab6fd13bba54dba16f

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.

===================================================================

M	source/blender/blenkernel/intern/gpencil_geom.cc

===================================================================

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);
 }



More information about the Bf-blender-cvs mailing list