Added viewport size calculation method.