1- import { Point , Rectangle } from '@pixi/math ' ;
1+ import { Point , Rectangle } from '@pixi/core ' ;
22
3- import type { IPointData } from '@pixi/math ' ;
4- import type { InteractionEvent } from '@pixi/interaction ' ;
3+ import type { IPointData } from '@pixi/core ' ;
4+ import type { FederatedPointerEvent } from '@pixi/events ' ;
55import type { Viewport } from './Viewport' ;
66
77export interface IViewportTouch
@@ -70,25 +70,25 @@ export class InputManager
7070 /**
7171 * handle down events for viewport
7272 *
73- * @param {PIXI.InteractionEvent } event
73+ * @param {PIXI.FederatedPointerEvent } event
7474 */
75- public down ( event : InteractionEvent ) : void
75+ public down ( event : FederatedPointerEvent ) : void
7676 {
7777 if ( this . viewport . pause || ! this . viewport . worldVisible )
7878 {
7979 return ;
8080 }
81- if ( event . data . pointerType === 'mouse' )
81+ if ( event . pointerType === 'mouse' )
8282 {
8383 this . isMouseDown = true ;
8484 }
85- else if ( ! this . get ( event . data . pointerId ) )
85+ else if ( ! this . get ( event . pointerId ) )
8686 {
87- this . touches . push ( { id : event . data . pointerId , last : null } ) ;
87+ this . touches . push ( { id : event . pointerId , last : null } ) ;
8888 }
8989 if ( this . count ( ) === 1 )
9090 {
91- this . last = event . data . global . clone ( ) ;
91+ this . last = event . global . clone ( ) ;
9292
9393 // clicked event does not fire if viewport is decelerating or bouncing
9494 const decelerate = this . viewport . plugins . get ( 'decelerate' , true ) ;
@@ -139,7 +139,7 @@ export class InputManager
139139 }
140140
141141 /** Handle move events for viewport */
142- public move ( event : InteractionEvent ) : void
142+ public move ( event : FederatedPointerEvent ) : void
143143 {
144144 if ( this . viewport . pause || ! this . viewport . worldVisible )
145145 {
@@ -150,8 +150,8 @@ export class InputManager
150150
151151 if ( this . clickedAvailable && this . last )
152152 {
153- const distX = event . data . global . x - this . last . x ;
154- const distY = event . data . global . y - this . last . y ;
153+ const distX = event . global . x - this . last . x ;
154+ const distY = event . global . y - this . last . y ;
155155
156156 if ( this . checkThreshold ( distX ) || this . checkThreshold ( distY ) )
157157 {
@@ -166,21 +166,21 @@ export class InputManager
166166 }
167167
168168 /** Handle up events for viewport */
169- public up ( event : InteractionEvent ) : void
169+ public up ( event : FederatedPointerEvent ) : void
170170 {
171171 if ( this . viewport . pause || ! this . viewport . worldVisible )
172172 {
173173 return ;
174174 }
175175
176- if ( event . data . pointerType === 'mouse' )
176+ if ( event . pointerType === 'mouse' )
177177 {
178178 this . isMouseDown = false ;
179179 }
180180
181- if ( event . data . pointerType !== 'mouse' )
181+ if ( event . pointerType !== 'mouse' )
182182 {
183- this . remove ( event . data . pointerId ) ;
183+ this . remove ( event . pointerId ) ;
184184 }
185185
186186 const stop = this . viewport . plugins . up ( event ) ;
@@ -191,7 +191,7 @@ export class InputManager
191191 event,
192192 screen : this . last ,
193193 world : this . viewport . toWorld ( this . last ) ,
194- viewport : this
194+ viewport : this . viewport
195195 } ) ;
196196 this . clickedAvailable = false ;
197197 }
0 commit comments