Fix T88262: Curve to mesh crash with vector last segment
The code incorrectly used the size of the second to last segment rather than the last segment's size. That was a problem when the last segment is a vector segment but the second to last isn't. I also used the opportunity to slightly refactor the control point offsets cache, making it one longer so it also contains information about the size of the last segment, simplifying other code.
This commit is contained in:
@@ -198,7 +198,7 @@ static void spline_extrude_to_mesh_data(const Spline &spline,
|
||||
if (profile_spline.type() == Spline::Type::Bezier) {
|
||||
const BezierSpline &bezier_spline = static_cast<const BezierSpline &>(profile_spline);
|
||||
Span<int> control_point_offsets = bezier_spline.control_point_offsets();
|
||||
for (const int i : control_point_offsets.index_range()) {
|
||||
for (const int i : IndexRange(bezier_spline.size())) {
|
||||
if (bezier_spline.point_is_sharp(i)) {
|
||||
mark_edges_sharp(r_edges.slice(
|
||||
spline_edges_start + spline_edge_len * control_point_offsets[i], spline_edge_len));
|
||||
|
Reference in New Issue
Block a user