Merge pull request #592 from elliottkember/patch-1

Fix: Correct onScale method signature in CKCamera.kt (again)
This commit is contained in:
Seph Soliman 2023-10-10 15:22:56 -07:00 committed by GitHub
commit d70ef7374c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,14 +185,14 @@ class CKCamera(context: ThemedReactContext) : FrameLayout(context), LifecycleObs
orientationListener!!.enable()
val scaleDetector = ScaleGestureDetector(context, object: ScaleGestureDetector.SimpleOnScaleGestureListener() {
override fun onScaleBegin(detector: ScaleGestureDetector?): Boolean {
override fun onScaleBegin(detector: ScaleGestureDetector): Boolean {
val cameraZoom = camera?.cameraInfo?.zoomState?.value?.zoomRatio ?: return false
detector ?: return false
zoomStartedAt = cameraZoom
pinchGestureStartedAt = detector.currentSpan
return true
}
override fun onScale(detector: ScaleGestureDetector?): Boolean {
override fun onScale(detector: ScaleGestureDetector): Boolean {
if (zoomMode == "off") return true
if (detector == null) return true
val videoDevice = camera ?: return true