         let gesturePoint =  gestureRecognizer.location(in: gestureRecognizer.view)
         delegate?.doubleTouch(in: self, location: gesturePoint)
         
-        if enabledZoomImageView {
-            // 如果图片被压缩了，则第一次放大到原图大小，第二次放大到最大倍数
-            if scrollView.zoomScale >= scrollView.maximumZoomScale {
-                setZoomScale(scrollView.minimumZoomScale, animated: true)
+        guard enabledZoomImageView else {
+            return
+        }
+
+        // 如果图片被压缩了，则第一次放大到原图大小，第二次放大到最大倍数
+        if scrollView.zoomScale >= scrollView.maximumZoomScale {
+            setZoomScale(scrollView.minimumZoomScale, animated: true)
+        } else {
+            var newZoomScale: CGFloat = 0
+            if scrollView.zoomScale < 1 {
+                // 如果目前显示的大小比原图小，则放大到原图
+                newZoomScale = 1
             } else {
-                var newZoomScale: CGFloat = 0
-                if scrollView.zoomScale < 1 {
-                    // 如果目前显示的大小比原图小，则放大到原图
-                    newZoomScale = 1
-                } else {
-                    // 如果当前显示原图，则放大到最大的大小
-                    newZoomScale = scrollView.maximumZoomScale
-                }
-                
-                var zoomRect = CGRect.zero
-                let tapPoint = currentContentView?.convert(gesturePoint, to: gestureRecognizer.view) ?? .zero
-                zoomRect.size.width = bounds.width / newZoomScale
-                zoomRect.size.height = bounds.height / newZoomScale
-                zoomRect.origin.x = tapPoint.x - zoomRect.width / 2
-                zoomRect.origin.y = tapPoint.y - zoomRect.height / 2
-                zoom(to: zoomRect, animated: true)
+                // 如果当前显示原图，则放大到最大的大小
+                newZoomScale = scrollView.maximumZoomScale
             }
+            
+            var zoomRect = CGRect.zero
+            let tapPoint = currentContentView?.convert(gesturePoint, to: gestureRecognizer.view) ?? .zero
+            zoomRect.size.width = bounds.width / newZoomScale
+            zoomRect.size.height = bounds.height / newZoomScale
+            zoomRect.origin.x = tapPoint.x - zoomRect.width / 2
+            zoomRect.origin.y = tapPoint.y - zoomRect.height / 2
+            zoom(to: zoomRect, animated: true)
         }
     }
     

        return rect
    }
    
    var enabledZoomImageView: Bool {
        var enabledZoom = true
        if let delegate = delegate {

        emptyView.frame = bounds
        
        let viewportRect = finalViewportRect
        videoCenteredPlayButton?.center = CGPoint(x: viewportRect.midX, y: viewportRect.midY)

        let height = videoToolbar?.sizeThatFits(CGSize.max).height ?? 0
        videoToolbar.frame = CGRect(x: 0, y: bounds.height - height, width: bounds.width, height: height)
    }

