Correctly resize the view when the window is resized.