mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 22:33:08 +00:00
The touch points of a drawn line were found by sampling each target segment in 24 steps and bisecting where the sign changed. When the line was exactly square or tangent at one of the samples, the value there was exactly 0, neither interval changed sign, and no snap was offered: for example the foot of a perpendicular from a point above a segment's middle, or a circle's tangent point when it fell exactly on a sample. A sample whose value is exactly 0 now counts as a touch point when its neighbors are not 0, so a straight curve seen from its own line still gives none. The ends of the segment, a cusp and a start point on the curve itself are left out, as between samples. Part of #7846