snapping with quadtree