Proper rendering during window resize.