added snapping for lines and rectangles