Simplify fit-to-screen code.