@capgo/camera-preview 7.22.0 → 7.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -71,7 +71,7 @@ class CameraController: NSObject {
|
|
|
71
71
|
var audioDevice: AVCaptureDevice?
|
|
72
72
|
var audioInput: AVCaptureDeviceInput?
|
|
73
73
|
|
|
74
|
-
var zoomFactor: CGFloat =
|
|
74
|
+
var zoomFactor: CGFloat = 1.0
|
|
75
75
|
private var lastZoomUpdateTime: TimeInterval = 0
|
|
76
76
|
private let zoomUpdateThrottle: TimeInterval = 1.0 / 60.0 // 60 FPS max
|
|
77
77
|
|
|
@@ -532,10 +532,10 @@ extension CameraController {
|
|
|
532
532
|
let minZoom = device.minAvailableVideoZoomFactor
|
|
533
533
|
let maxZoom = min(device.maxAvailableVideoZoomFactor, saneMaxZoomFactor)
|
|
534
534
|
|
|
535
|
-
// Compute UI-level default
|
|
535
|
+
// Compute UI-level default (1×) when not provided
|
|
536
536
|
let multiplier = self.getDisplayZoomMultiplier()
|
|
537
|
-
//
|
|
538
|
-
let uiLevel: Float = level ??
|
|
537
|
+
// If level is nil, fall back to a UI zoom of 1.0×
|
|
538
|
+
let uiLevel: Float = level ?? 1.0
|
|
539
539
|
// Map UI/display zoom to native zoom using iOS 18+ multiplier
|
|
540
540
|
let adjustedLevel = multiplier != 1.0 ? (uiLevel / multiplier) : uiLevel
|
|
541
541
|
|
|
@@ -1515,7 +1515,7 @@ public class CameraPreview: CAPPlugin, CAPBridgedPlugin, CLLocationManagerDelega
|
|
|
1515
1515
|
}
|
|
1516
1516
|
|
|
1517
1517
|
let ramp = call.getBool("ramp") ?? true
|
|
1518
|
-
let autoFocus = call.getBool("autoFocus") ??
|
|
1518
|
+
let autoFocus = call.getBool("autoFocus") ?? true
|
|
1519
1519
|
|
|
1520
1520
|
do {
|
|
1521
1521
|
try self.cameraController.setZoom(level: CGFloat(level), ramp: ramp, autoFocus: autoFocus)
|