InteractionManager cannot read properties - PointerOverOut TreeSearch
See original GitHub issue@davidfig David, hi - when I add Pixi Viewport to latest Pixi, mouse wheel zoom works but mouseover / scroll pan errors:
InteractionManager.ts:1723 Uncaught TypeError: Cannot read properties of undefined (reading ‘1’) at InteractionManager.processPointerOverOut (InteractionManager.ts:1723:1) at TreeSearch.recursiveFindHit (TreeSearch.ts:173:1) at TreeSearch.recursiveFindHit (TreeSearch.ts:113:1) at TreeSearch.findHit (TreeSearch.ts:200:1) at InteractionManager.processInteractive (InteractionManager.ts:1256:1) at InteractionManager.update (InteractionManager.ts:1090:1) at InteractionManager.tickerUpdate (InteractionManager.ts:1049:1) at TickerListener.emit (TickerListener.ts:68:1) at Ticker.update (Ticker.ts:444:1) at Ticker._tick (Ticker.ts:129:1)
"pixi.js": "^6.2.2",
"pixi-viewport": "^4.34.4"
Implemented as:
this.app = new Application({
antialias: true,
backgroundColor: 0x0,
resolution: devicePixelRatio,
width: 400,
height: 400,
});
this.viewport = new Viewport({
worldWidth: 400,
worldHeight: 400,
screenWidth: window.innerWidth,
screenHeight: window.innerHeight,
divWheel: this.app.view,
interaction: this.app.renderer.plugins.interaction,
})
.drag()
.pinch({ percent: 2 })
.wheel()
.decelerate();
this.app.stage.addChild(this.viewport);
this.app.ticker.start();
For testing, I added a const g = new PIXI.Graphics()
with some line drawing and this.viewport.addChild(g)
.
Any new conflicts between versions?
Is the interaction manager still the same from the app renderer plugins?
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
@peili It occurred with a TypeScript npm package of mine that’s using PIxi.js v6.2.2 with the isolated code above, then adding a
PIXI.Graphics
instance for testing.If I move that code to an app, I can’t reproduce it - everything works fine.
I think Pixi’s
TreeSearch
has undergone some development recently - I initially thought it was a Pixi.js problem; however, there are no errors when I remove Pixi Viewport, which led me here.Sorry that’s not of more help - I can’t seem to isolate an app that reproduces the issue, but I might have more insight in the near future.
@peili I matched Pixi.js version to Pixi Viewport version in package.json
Not entirely sure it related to Pixi Viewport, as I had another dependency with mismatched versions.
Also, I believe there is an error in Pixi regarding TreeSearch - not sure if it’s related or not: https://github.com/pixijs/pixijs/issues/8179