New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
InteractionManager refactoring: extract TreeSearch #6089
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #6089 +/- ##
==========================================
+ Coverage 70.87% 70.89% +0.02%
==========================================
Files 208 209 +1
Lines 10648 10656 +8
==========================================
+ Hits 7547 7555 +8
Misses 3101 3101
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trusting the unit-tests on this one! Code reorg looks good though.
Thanks @ivanpopelyshev, good one. |
I've got many ideas how to make our interaction code more clear and moddable.
This is first PR in a sequence: I removed 180 lines of code from huge 1900 lines file and got rid of 2 params in a function call.
Here's the biggest case when we need to inject different search behaviour: https://github.com/pixijs/pixi-layers/blob/master/src/InteractionManagerMixin.ts
Several changes in interaction were the reason why users stuck with particular versions of pixijs.
I need help with testing that thing, but it should be easy - I didnt add any new features, just copied the code&docs and passed params.
Why is it separate class, and not a mixin? I think that after several PR's we'll be able to give ability to use treeSearch for hittesting independently of interaction, and with many optional params, like hittesting several objects. Also, someone might do something like
right now that kind of constructions can affect delayedEvents and other things. Having search-related local variables (queue?) not as params of recursive function will be handy.
Lets start with easy stuff!
And decide on the name...