adjust viewport calculations to actually use the viewport