Update the logic of calc viewports.