added snapping for rectangles