Implemented corner cases handling for screen rotation close #15 [skip ci]