Fixed #3569: Correct the direction of viewport