From e7a2f5d6d4eaca6adc3b217e444f4ee97027d93d Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 31 Dec 2021 04:42:56 -0500 Subject: [PATCH] added NaN check on pinch event (#476) --- packages/tldraw/src/state/tools/BaseTool.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/tldraw/src/state/tools/BaseTool.ts b/packages/tldraw/src/state/tools/BaseTool.ts index 824153b7f..c3b0ed43e 100644 --- a/packages/tldraw/src/state/tools/BaseTool.ts +++ b/packages/tldraw/src/state/tools/BaseTool.ts @@ -77,6 +77,7 @@ export abstract class BaseTool extends TDEventHandler { onPinch: TLPinchEventHandler = (info, e) => { if (this.status !== 'pinching') return + if (isNaN(info.delta[0]) || isNaN(info.delta[1])) return this.app.pinchZoom(info.point, info.delta, info.delta[2]) this.onPointerMove?.(info, e as unknown as React.PointerEvent) }