Skip to content

Commit

Permalink
bug(@capacitor/screen-orientation): iOS landscape lock using incorrec…
Browse files Browse the repository at this point in the history
…t mappings (#2086)

Co-authored-by: Brian Weasner <84519320+brian-weasner@users.noreply.github.com>
  • Loading branch information
OS-ricardomoreirasilva and brian-weasner committed Apr 19, 2024
1 parent ebb9577 commit f784a3e
Showing 1 changed file with 12 additions and 4 deletions.
Expand Up @@ -85,9 +85,11 @@ public class ScreenOrientation: NSObject {
case "any":
return UIInterfaceOrientationMask.all
case "landscape", "landscape-primary":
return UIInterfaceOrientationMask.landscapeLeft
case "landscape-secondary":
// UIInterfaceOrientationMask.landscapeRight is the same as UIDeviceOrientation.landscapeLeft
return UIInterfaceOrientationMask.landscapeRight
case "landscape-secondary":
// UIInterfaceOrientationMask.landscapeLeft is the same as UIDeviceOrientation.landscapeRight
return UIInterfaceOrientationMask.landscapeLeft
case "portrait-secondary":
return UIInterfaceOrientationMask.portraitUpsideDown
default:
Expand All @@ -101,9 +103,15 @@ public class ScreenOrientation: NSObject {
case "any":
return UIInterfaceOrientation.unknown.rawValue
case "landscape", "landscape-primary":
return UIInterfaceOrientation.landscapeLeft.rawValue
case "landscape-secondary":
// UIInterfaceOrientation.landscapeRight is the same as UIDeviceOrientation.landscapeLeft
// @see https://developer.apple.com/documentation/uikit/uiinterfaceorientation/landscaperight
// @see https://developer.apple.com/documentation/uikit/uideviceorientation/landscapeleft
return UIInterfaceOrientation.landscapeRight.rawValue
case "landscape-secondary":
// UIInterfaceOrientation.landscapeLeft is the same as UIDeviceOrientation.landscapeRight
// @see https://developer.apple.com/documentation/uikit/uiinterfaceorientation/landscapeleft
// @see https://developer.apple.com/documentation/uikit/uideviceorientation/landscaperight
return UIInterfaceOrientation.landscapeLeft.rawValue
case "portrait-secondary":
return UIInterfaceOrientation.portraitUpsideDown.rawValue
default:
Expand Down

0 comments on commit f784a3e

Please sign in to comment.