Closed janusw closed 6 months ago
I think the origin of the bug is this piece of code:
The UIDeviceOrientation
enum, which is used here, also includes the cases faceUp
and faceDown
, which are not handled in the above snippet. This seems to be the reason for the misbehavior: If the device is in faceUp
or faceDown
mode, the rotation of the preview is not determined correctly.
The best solution is probably to use UIInterfaceOrientation
instead of UIDeviceOrientation
. This does not include faceUp
/faceDown
, and in fact it's not relevant how the device itself is oriented, but rather how the app on the device is oriented.
To reproduce (with version 1.4.7):