implements snapping on end points of entities