1
1

Fix T100768: Reverse curves skips handles of middle Bezier points

Reversing Bezier handle types and positions would skip the middle point
of curves with an odd number of segments, which is still necessary to
swap in order to avoid changing the curve's shape.
This commit is contained in:
2022-09-02 12:05:12 -05:00
parent e02e844f51
commit 28d8076a2e

View File

@@ -1345,6 +1345,10 @@ static void reverse_swap_curve_point_data(const CurvesGeometry &curves,
std::swap(a[end_index], b[i]);
std::swap(b[end_index], a[i]);
}
if (points.size() % 2) {
const int64_t middle_index = points.size() / 2;
std::swap(a[middle_index], b[middle_index]);
}
}
});
}