From 2d57445fe0409eff3e54e0a4c06abfc8a2dfd939 Mon Sep 17 00:00:00 2001 From: Septicity Date: Tue, 14 Apr 2026 05:23:38 -0500 Subject: [PATCH] Make pinch zoom gesture not trigger double tap gesture --- src/app/hooks/useImageGestures.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/hooks/useImageGestures.ts b/src/app/hooks/useImageGestures.ts index f52d666ca..e748b9c7c 100644 --- a/src/app/hooks/useImageGestures.ts +++ b/src/app/hooks/useImageGestures.ts @@ -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) => {