Improve the resize process when the device orientation is changed.