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:
parent
80c9ab4bd3
commit
2699ce8dfe
@ -100,7 +100,8 @@ export default function usePointer(options: PointerConfigInterface): PointerInte
|
|||||||
|
|
||||||
function updatePosition(event: TouchEvent | MouseEvent) {
|
function updatePosition(event: TouchEvent | MouseEvent) {
|
||||||
let x, y
|
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
|
x = (<TouchEvent>event).touches[0].clientX
|
||||||
y = (<TouchEvent>event).touches[0].clientY
|
y = (<TouchEvent>event).touches[0].clientY
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user