fix refresh with rotation and viewport
Merge pull request #1136 from hwhw/master

fix refresh with rotation and viewport