Simplified the viewport size management.