Added support for reversed landscape and portrait orientations