-
Notifications
You must be signed in to change notification settings - Fork 450
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
FlxMouseEventManager: correct the mouseChildren parameter, closes #2102 #2110
Conversation
I would also like to have a unit test for this, if possible. |
I'd like for sprite groups with |
Essentially, the @Gama11 my breaking question is if |
Will unit test, but the most recent commit keeps |
What's the status here? Is that |
Ehhhhh if you want it to be. Finding some time this and next weekend to code. |
Ok |
var sprites = [sprite3, sprite1, sprite2, sprite0]; | ||
for (i in 0...sprites.length) | ||
{ | ||
Assert.areEqual(sprites[i], FlxMouseEventManager._registeredObjects[i].object); |
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.
This is really hacky, a unit test shouldn't need to rely on @:access()
, only public API.
the parameter set to false still allowed overlapping objects to receive events.
You should be able to test for that not happening anymore?
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.
(you should be able to dispatch mouse events manually, similar to what we do here:
https://github.com/HaxeFlixel/flixel/blob/dev/tests/unit/src/flixel/input/gamepad/FlxGamepadManagerTest.hx)
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.
Ohhh I didn't think of that. That's a much better test, yeah.
Also allows re-setting mouseChildren to reorder sprites
Ok, again. |
Nice, that's much cleaner. 👍 |
Closes #2102
Fixes a bug with
mouseChildren
inFlxMouseEventManager
where items with the parameter set to false still allowed overlapping objects to receive events. E.g. the children of a parent sprite group withmouseChildren = false
still received events if they were added toFlxMEM
after.I forgot I made this changeI've been using this change since the issue and haven't had any problems. It does break the order of the objects if that's a concern, which I could change but would be more involved.