Moved zoom logic into viewport.