@capgo/capacitor-stream-call 0.0.33 → 0.0.35
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.
|
@@ -5,6 +5,10 @@ import WebKit
|
|
|
5
5
|
class TouchInterceptView: UIView {
|
|
6
6
|
private weak var webView: UIView?
|
|
7
7
|
private weak var overlayView: UIView?
|
|
8
|
+
private var forwardTimer: Timer?
|
|
9
|
+
private var lastTouchPoint: CGPoint?
|
|
10
|
+
private let touchThreshold: CGFloat = 5.0 // pixels
|
|
11
|
+
private let timerDelay: TimeInterval = 0.1 // seconds
|
|
8
12
|
|
|
9
13
|
func setupWithWebView(_ webView: UIView, overlayView: UIView) {
|
|
10
14
|
self.webView = webView
|
|
@@ -76,9 +80,26 @@ class TouchInterceptView: UIView {
|
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
os_log(.debug, "TouchInterceptView: hitTest entry at %{public}s", String(describing: point))
|
|
84
|
+
|
|
85
|
+
// Check if this is same touch location continuing
|
|
86
|
+
if let lastPoint = lastTouchPoint {
|
|
87
|
+
let distance = sqrt(pow(point.x - lastPoint.x, 2) + pow(point.y - lastPoint.y, 2))
|
|
88
|
+
if distance <= touchThreshold {
|
|
89
|
+
// Same touch continuing, cancel existing timer
|
|
90
|
+
forwardTimer?.invalidate()
|
|
91
|
+
os_log(.debug, "TouchInterceptView: Touch continuing at %{public}s, cancelling timer", String(describing: point))
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// Store current point and start new timer
|
|
96
|
+
lastTouchPoint = point
|
|
97
|
+
forwardTimer?.invalidate()
|
|
98
|
+
forwardTimer = Timer.scheduledTimer(withTimeInterval: timerDelay, repeats: false) { [weak self] _ in
|
|
99
|
+
os_log(.debug, "TouchInterceptView: Timer fired, forwarding click to web at %{public}s", String(describing: point))
|
|
100
|
+
self?.forwardClickToWeb(at: point)
|
|
101
|
+
}
|
|
102
|
+
|
|
82
103
|
// 1. interactive hit on overlay (including root)
|
|
83
104
|
if let overlayView = self.overlayView, !overlayView.isHidden {
|
|
84
105
|
let overlayPoint = self.convert(point, to: overlayView)
|
package/package.json
CHANGED