pixijs / layers

Separate the z-hierarchy of your scene tree from its canonical structure.
https://pixijs.io/layers/docs/
MIT License
220 stars 57 forks source link

InteractionCallback getting passed as null to pixi layers findHit, resulting in error #69

Closed Redmega closed 2 years ago

Redmega commented 3 years ago

plugins.interaction.hitTest sends null for the InteractionCallback of processInteractive, which in turn drills down to @pixi/layers this._finishInteractionProcess which calls it without actually checking that it exists/is callable.

https://github.com/pixijs/pixi-layers/blob/75c4078445b30f27cca153cfb931e37bff734edd/src/LayersTreeSearch.ts#L180-L182

You check that func exists when processing the second queue item, but not the first. Is this just an oversight or is there a reason for that?

If you look at the same function in the v5 branch, it seems like it's much more careful about what it's passed: https://github.com/pixijs/pixi-layers/blob/4b5b29d6f1770fb0d40f21848bd7b35e00a6a931/src/LayersTreeSearch.ts#L153-L163

Redmega commented 2 years ago

Closed by #77