diff options
author | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2021-01-17 11:48:16 -0800 |
---|---|---|
committer | Lionel Han <47760119+IGoByJoe@users.noreply.github.com> | 2021-01-17 11:48:16 -0800 |
commit | fd4a1c602396362e9f0a1effa87fc751614e541b (patch) | |
tree | 400d22b39d3e8281f34b8834cf4c73ddc1a9551e /src/client/util/InteractionUtils.tsx | |
parent | 692e619d8775e273c32e7bde804718b3e691088b (diff) | |
parent | f4f4cb6b3a639c3e1c0d291f1d290e80097cfa06 (diff) |
changes
Diffstat (limited to 'src/client/util/InteractionUtils.tsx')
-rw-r--r-- | src/client/util/InteractionUtils.tsx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx index f58277717..01d00db30 100644 --- a/src/client/util/InteractionUtils.tsx +++ b/src/client/util/InteractionUtils.tsx @@ -364,12 +364,9 @@ export namespace InteractionUtils { export function IsType(e: PointerEvent | React.PointerEvent, type: string): boolean { switch (type) { // pen and eraser are both pointer type 'pen', but pen is button 0 and eraser is button 5. -syip2 - case PENTYPE: - return e.pointerType === PENTYPE && (e.button === -1 || e.button === 0); - case ERASERTYPE: - return e.pointerType === PENTYPE && e.button === (e instanceof PointerEvent ? ERASER_BUTTON : ERASER_BUTTON); - default: - return e.pointerType === type; + case PENTYPE: return e.pointerType === PENTYPE && (e.button === -1 || e.button === 0); + case ERASERTYPE: return e.pointerType === PENTYPE && e.button === (e instanceof PointerEvent ? ERASER_BUTTON : ERASER_BUTTON); + default: return e.pointerType === type; } } |