Path snapping now uses 2D distance to prevent weird behaviour (fixes #697)