mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 22:21:59 +00:00
Spine::at_length walked the first subpath's segments from the start until one ended at or past the arc length, so placing every blend step, spread key, blend widget and Objects on Path attachment cost one comparison per earlier segment. It now searches the anchors' arc lengths, which never decrease, and picks the same segment: the first whose end is at or past the length, so an exact anchor length and repeated lengths from zero-length segments keep their segment. The point and tangent evaluation is unchanged. Tests compare the search with the old walk on open and closed spines, one segment, curves, zero-length segments, every anchor, both ends, out-of-range and non-finite lengths, and check that a 4,096-segment spine needs at most 13 comparisons.