Shuffling around some of the viewport code.

Performance improvement to only calc the viewport size when zooming and
at init.