added NaN check on pinch event (#476)
This commit is contained in:
parent
bc37947d5e
commit
e7a2f5d6d4
1 changed files with 1 additions and 0 deletions
|
@ -77,6 +77,7 @@ export abstract class BaseTool<T extends string = any> extends TDEventHandler {
|
||||||
|
|
||||||
onPinch: TLPinchEventHandler = (info, e) => {
|
onPinch: TLPinchEventHandler = (info, e) => {
|
||||||
if (this.status !== 'pinching') return
|
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.app.pinchZoom(info.point, info.delta, info.delta[2])
|
||||||
this.onPointerMove?.(info, e as unknown as React.PointerEvent)
|
this.onPointerMove?.(info, e as unknown as React.PointerEvent)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue