Fix: Grease Pencil: Crash in curves_merge_by_distance for cyclic curves
The issue was that the size of `distances_along_curve` was wrong for cyclic curves. The fix increases the size by one for cyclic curves to account for the last segment length.
This commit is contained in:
@@ -233,7 +233,7 @@ blender::bke::CurvesGeometry curves_merge_by_distance(const bke::CurvesGeometry
|
||||
const IndexRange points = points_by_curve[curve_i];
|
||||
merge_indices_per_curve[curve_i].reinitialize(points.size());
|
||||
|
||||
Array<float> distances_along_curve(points.size());
|
||||
Array<float> distances_along_curve(points.size() + int(cyclic[curve_i]));
|
||||
distances_along_curve.first() = 0.0f;
|
||||
const Span<float> lengths = src_curves.evaluated_lengths_for_curve(curve_i, cyclic[curve_i]);
|
||||
distances_along_curve.as_mutable_span().drop_front(1).copy_from(lengths);
|
||||
|
||||
Reference in New Issue
Block a user