From 63b3c302fb45ef0b5f6097fbea280e85e13780c8 Mon Sep 17 00:00:00 2001 From: Teng Tokoro Date: Thu, 15 Jan 2026 23:25:54 -0800 Subject: [PATCH] fix: prevent zooming out when horizontal wheel is rotated --- src/zoom.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/zoom.ts b/src/zoom.ts index d668ab0..e37b31d 100644 --- a/src/zoom.ts +++ b/src/zoom.ts @@ -36,10 +36,7 @@ export class Zoom { e.preventDefault() const { left, top } = this.element.getBoundingClientRect() - const isNegative = e.deltaY < 0 - const delta = isNegative - ? this.intensity - : -this.intensity + const delta = -this.intensity * Math.sign(e.deltaY); const ox = (left - e.clientX) * delta const oy = (top - e.clientY) * delta