fix: Fix focus(..) on iOS (#2220)

This commit is contained in:
Marc Rousavy 2023-11-27 14:43:56 +01:00 committed by GitHub
parent 7047686ff9
commit d78798ff84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -12,7 +12,8 @@ import Foundation
extension CameraView { extension CameraView {
func focus(point: CGPoint, promise: Promise) { func focus(point: CGPoint, promise: Promise) {
withPromise(promise) { withPromise(promise) {
try cameraSession.focus(point: point) let normalized = previewView.captureDevicePointConverted(fromLayerPoint: point)
try cameraSession.focus(point: normalized)
return nil return nil
} }
} }

View File

@ -21,6 +21,8 @@ extension CameraSession {
throw CameraError.device(DeviceError.focusNotSupported) throw CameraError.device(DeviceError.focusNotSupported)
} }
ReactLogger.log(level: .info, message: "Focusing (\(point.x), \(point.y))...")
do { do {
try device.lockForConfiguration() try device.lockForConfiguration()
defer { defer {