fix the viewport reshape function doesn't work properly