Simplify the logic to resize viewer controls.