Skip to content

Conversation

@ej-sanmartin
Copy link

Fixes #2238


This PR fixes two issues in BezierCurve::renderSegment:

  • Reversed argument handling (start > end)
    The existing else if (end > start) branch was unreachable due to the
    preceding start < end check. As a result, calling renderSegment with
    reversed parameters returned the full curve instead of the intended subrange.
    The condition is corrected so reversed ranges now slice the proper segment.

  • Asymmetric rounding when slicing sampled vertices
    The forward and reversed paths previously used different rounding rules,
    causing renderSegment(a, b) and renderSegment(b, a) to select slightly
    different vertex ranges. Index calculation is now normalized so both cases
    refer to the same portion of the sampled curve.


Result

renderSegment now handles reversed arguments consistently and returns the
correct sub-curve in both orders, with stable and predictable indexing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue in BezierCurve->RenderSegment

1 participant