Skip to content

Instantly share code, notes, and snippets.

@Krzysztof-FF
Krzysztof-FF / README.md
Last active October 24, 2019 11:18 — forked from patricksurry/README.md
SVG Snap - draw utilizing plain hover snap

This example modifies my own draw with nearest neighbor snap to draw polyline using snap to chosen point.
To make snap active, circle area around desired target point should be hovered by cursor position.
This example was created to examine feasibility of such idea.
Unfortunately, choosing between densely distributed points in some cases is almost impossible.
Going closer to desired points may not help, if area around other point in close proximity is hovered already.
Sometimes it is necessary to approach to desired point from some alternate direction so as not to activate other attraction areas.
To make this example feasible, I had to decrease distance tolerance to 10 (comparing to 20 in previous case).