Fix an assert in contour_measure.cpp Since fp32 has finite precision, a segment may reasonably become degenerate with length 0, and we need to be robust enough to handle this. Asserting that the distance is non-negative is still a good test. Fixes #7210. Diffs= 806ae1fae Fix an assert in contour_measure.cpp (#7232) Co-authored-by: Chris Dalton <99840794+csmartdalton@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head index 9faac26..42e7060 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -7d03c3fafeefd05513c4a418f320322ecd1c1e4e +806ae1faea4cc10452c76a4ce2b35f2ca12aa469
diff --git a/src/math/contour_measure.cpp b/src/math/contour_measure.cpp index 57c833c..247f908 100644 --- a/src/math/contour_measure.cpp +++ b/src/math/contour_measure.cpp
@@ -34,7 +34,7 @@ // or the last segment if distance == m_distance size_t ContourMeasure::findSegment(float distance) const { - assert(m_segments.front().m_distance > 0); + assert(m_segments.front().m_distance >= 0); assert(m_segments.back().m_distance == m_length); assert(distance >= 0 && distance <= m_length);