Fixed math in portal viewport