fixed a bug if viewport spans -180/180 degrees