fix bugs in transition between portrait and landscape on tablet.