More accurate window resize in widescreen mode

Yesterday's implementation caused a gap at the bottom of the window that
widened with each resize of the window. This fixes that. Plus a bit of
reformatting.