mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
Merge branch 'main' into use-mpvkit
This commit is contained in:
@@ -79,14 +79,16 @@ public class OrientationTracker {
|
||||
let threshold = 0.55
|
||||
if accelerometerData.acceleration.x >= threshold {
|
||||
return .landscapeLeft
|
||||
} else if accelerometerData.acceleration.x <= -threshold {
|
||||
return .landscapeRight
|
||||
} else if accelerometerData.acceleration.y <= -threshold {
|
||||
return .portrait
|
||||
} else if accelerometerData.acceleration.y >= threshold {
|
||||
return .portraitUpsideDown
|
||||
} else {
|
||||
return currentDeviceOrientation
|
||||
}
|
||||
if accelerometerData.acceleration.x <= -threshold {
|
||||
return .landscapeRight
|
||||
}
|
||||
if accelerometerData.acceleration.y <= -threshold {
|
||||
return .portrait
|
||||
}
|
||||
if accelerometerData.acceleration.y >= threshold {
|
||||
return .portraitUpsideDown
|
||||
}
|
||||
return currentDeviceOrientation
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user