fix double rotation

Signed-off-by: Toni Förster <toni.foerster@gmail.com>
This commit is contained in:
Toni Förster
2024-09-06 16:47:03 +02:00
parent 2185718d50
commit 4e4add3c42
7 changed files with 13 additions and 15 deletions

View File

@@ -22,8 +22,8 @@ import SwiftUI
// not sure why but first rotation call is ignore so doing rotate to same orientation first
Delay.by(delay) {
let orientation = OrientationTracker.shared.currentDeviceOrientation.isLandscape ? OrientationTracker.shared.currentInterfaceOrientation : self.rotateToLandscapeOnEnterFullScreen.interfaceOrientation
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: orientation)
Orientation.lockOrientation(.all, andRotateTo: OrientationTracker.shared.currentInterfaceOrientation)
Orientation.lockOrientation(.all, andRotateTo: orientation)
}
}
}
@@ -37,7 +37,7 @@ import SwiftUI
if !context.isCancelled {
#if os(iOS)
if Constants.isIPhone {
Orientation.lockOrientation(.allButUpsideDown, andRotateTo: .portrait)
Orientation.lockOrientation(.all, andRotateTo: .portrait)
}
if wasPlaying {