Skip to content

Commit 4d7b522

Browse files
committed
Use true north for device orientation when available
1 parent 3778357 commit 4d7b522

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

submodules/WebUI/Sources/WebAppController.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2246,7 +2246,11 @@ public final class WebAppController: ViewController, AttachmentContainable {
22462246

22472247
var effectiveIsAbsolute = false
22482248
let referenceFrame: CMAttitudeReferenceFrame
2249-
if absolute && CMMotionManager.availableAttitudeReferenceFrames().contains(.xMagneticNorthZVertical) {
2249+
2250+
if absolute && [.authorizedWhenInUse, .authorizedAlways].contains(CLLocationManager.authorizationStatus()) && CMMotionManager.availableAttitudeReferenceFrames().contains(.xTrueNorthZVertical) {
2251+
referenceFrame = .xTrueNorthZVertical
2252+
effectiveIsAbsolute = true
2253+
} else if absolute && CMMotionManager.availableAttitudeReferenceFrames().contains(.xMagneticNorthZVertical) {
22502254
referenceFrame = .xMagneticNorthZVertical
22512255
effectiveIsAbsolute = true
22522256
} else {

0 commit comments

Comments
 (0)