mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
Make pinch zoom gesture not trigger double tap gesture
This commit is contained in:
1 parent
e7539b5570
commit
2d57445fe0
1 file changed
+7
@@ -129,6 +129,13 @@ export const useImageGestures = (active: boolean, step = 0.2, min = 0.1, max = 5
|
||||
// Double click zoom
|
||||
const now = Date.now();
|
||||
if (now - lastTapRef.current < 300) {
|
||||
// If two cursors are active, this isn't a double click.
|
||||
if (activePointers.current.size === 2) {
|
||||
const points = Array.from(activePointers.current.values());
|
||||
initialDist.current = Math.hypot(points[0].x - points[1].x, points[0].y - points[1].y);
|
||||
return;
|
||||
}
|
||||
|
||||
const container = target.parentElement ?? target;
|
||||
const containerRect = container.getBoundingClientRect();
|
||||
setTransforms((prev) => {
|
||||
|
||||
Reference in new issue
Block a user