Fix scaling for different viewports.