Added snap to edge of window feature