add function to snap to closest corner on resize