Skip to content

Commit aa18c4f

Browse files
authored
Merge pull request #34 from gugmaster2/fix-wrong-orientation-in-landscape-initially
fix: wrong orientation initially on iOS in landscape
2 parents e0210f4 + 6b1a83c commit aa18c4f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scanner/src/iosMain/kotlin/ScannerView.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ class ScannerCameraCoordinator(
155155
previewLayer = AVCaptureVideoPreviewLayer(session = captureSession).also {
156156
it.frame = layer.bounds
157157
it.videoGravity = AVLayerVideoGravityResizeAspectFill
158-
setCurrentOrientation(newOrientation = UIDevice.currentDevice.orientation)
159158
layer.addSublayer(it)
160159
}
161160

@@ -194,5 +193,7 @@ class ScannerCameraCoordinator(
194193

195194
fun setFrame(rect: CValue<CGRect>) {
196195
previewLayer?.setFrame(rect)
196+
197+
setCurrentOrientation(newOrientation = UIDevice.currentDevice.orientation)
197198
}
198199
}

0 commit comments

Comments
 (0)