mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-13 22:21:59 +00:00
Join removed each merged anchor from the path's anchor list as it went, which moved every anchor after it, so a long selected run in front of many other anchors took time quadratic in the path's length. It also looked up each anchor's selection in the selected-anchor set. Join now marks the merged anchors and removes them in one pass at the end, reading the selection from one flag per anchor. Each corner or smooth conversion sees the same neighbors as before, so the resulting anchors are unchanged. Anchor::smooth_between holds the smoothing that SubPath::smooth_anchor applies. Tests compare the new merge bit for bit with the old one on 30,000 generated paths, and count the anchors moved when 300,000 selected anchors in front of 300,000 others merge: each of the others moves once.