1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-23 20:02:32 +08:00

fix "TouchEvent is not defined"

This commit is contained in:
Kevin Levron 2021-04-29 21:41:51 +02:00
parent 80c9ab4bd3
commit 2699ce8dfe

View File

@ -100,7 +100,8 @@ export default function usePointer(options: PointerConfigInterface): PointerInte
function updatePosition(event: TouchEvent | MouseEvent) {
let x, y
if (event instanceof TouchEvent && event.touches && event.touches.length > 0) {
// @ts-ignore
if (event.touches && event.touches.length > 0) {
x = (<TouchEvent>event).touches[0].clientX
y = (<TouchEvent>event).touches[0].clientY
} else {