diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/geometry/intern/add_curves_on_mesh.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/geometry/intern/add_curves_on_mesh.cc b/source/blender/geometry/intern/add_curves_on_mesh.cc index 25935691bf4..a03c9b994a9 100644 --- a/source/blender/geometry/intern/add_curves_on_mesh.cc +++ b/source/blender/geometry/intern/add_curves_on_mesh.cc @@ -385,10 +385,11 @@ AddCurvesOnMeshOutputs add_curves_on_mesh(CurvesGeometry &curves, return true; } bke::GSpanAttributeWriter attribute = attributes.lookup_for_write_span(id); - const int new_elements_num = attribute.domain == ATTR_DOMAIN_POINT ? new_points_num : - new_curves_num; + /* The new elements are added at the end of the array. */ + const int old_elements_num = attribute.domain == ATTR_DOMAIN_POINT ? old_points_num : + old_curves_num; const CPPType &type = attribute.span.type(); - GMutableSpan new_data = attribute.span.take_back(new_elements_num); + GMutableSpan new_data = attribute.span.drop_front(old_elements_num); type.fill_assign_n(type.default_value(), new_data.data(), new_data.size()); attribute.finish(); return true; |