Fix: Failed assert for evaluated lengths of single point curves

Since 2d80f814cc, curves always have evaluated points,
but single point curves do no have any evaluated segments, and the
leading zero length isn't stored in the curves length cache.
This commit is contained in:
Hans Goudey
2022-05-29 13:43:25 +02:00
parent 86cfc30aac
commit 218f23935c

View File

@@ -785,6 +785,9 @@ inline float CurvesGeometry::evaluated_length_total_for_curve(const int curve_in
const bool cyclic) const
{
const Span<float> lengths = this->evaluated_lengths_for_curve(curve_index, cyclic);
if (lengths.is_empty()) {
return 0.0f;
}
return lengths.last();
}