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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user