fixed problem attributable to device rotate.
Merge pull request #2 from kyouhei/fixRotateProblem

Fixed problem attributable to device rotate.