GPv3: Duplicate operator (edit mode) #115389

Merged
Falk David merged 23 commits from casey-bianco-davis/blender:GPv3-Duplicate into main 2023-12-01 10:14:23 +01:00
Showing only changes of commit 666e48ad48 - Show all commits

View File

@ -1505,9 +1505,10 @@ static bke::CurvesGeometry duplicate_points(const bke::CurvesGeometry &curves,
const IndexRange range = ranges_to_duplicate[range_i];
casey-bianco-davis marked this conversation as resolved Outdated

Use const.

Use `const`.
int count = range.size();
for (const int src_point : range.shift(points.first())) {
dst_to_src_point[curr_dst_point_id++] = src_point;
}
array_utils::fill_index_range<int>(
casey-bianco-davis marked this conversation as resolved Outdated

We can replace this loop with fill_index_range as well.

array_utils::fill_index_range<int>(
    dst_to_src_point.as_mutable_span().slice(curr_dst_point_id, count),
    range.start() + points.first());
curr_dst_point_id += range.size();
We can replace this loop with `fill_index_range` as well. ``` array_utils::fill_index_range<int>( dst_to_src_point.as_mutable_span().slice(curr_dst_point_id, count), range.start() + points.first()); curr_dst_point_id += range.size(); ```
dst_to_src_point.as_mutable_span().slice(curr_dst_point_id, count),
range.start() + points.first());
curr_dst_point_id += range.size();
/* Join the first range to the end of the last range. */
if (is_curve_self_joined && range_i == range_ids.last()) {
casey-bianco-davis marked this conversation as resolved
Review

Move this below const IndexRange range_ids ouside of the loop.

Move this below `const IndexRange range_ids` ouside of the loop.