Skip to content
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

v3 issues with interaction #1901

Closed
nt-pch opened this issue Jun 16, 2015 · 13 comments
Closed

v3 issues with interaction #1901

nt-pch opened this issue Jun 16, 2015 · 13 comments
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release. 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. 🔍 Needs Investigation Issue needs to be research or investigated further. 💾 v4.x (Legacy) Legacy version 4 support

Comments

@nt-pch
Copy link

nt-pch commented Jun 16, 2015

Hi folks, first... thanks for such a great library!

I'm noticing differences in how v3 works in comparison to v2. I'm running Chrome 43.0.2357.124 on a Max OS 10.10.3.

I have a graphic red box in a container. The red box is listening to mouse events. http://jsfiddle.net/ar4pjetx/

  1. If there is another non-interactive graphic on top of the red box and the red box's parent container has set ‘interactive = true', the red box no longer responds to events where the green box is overlapping, i.e., when mousing over both boxes, if the green box is present, then the red box thinks that the mouse is no longer over it. My expectation is that the box events should not be blocked by a non-interactive object on top of it. This is how v2 worked.
  • If I remove line 32 (stage.interactive = true), then the events fire as expected.
  1. When logging events in Chrome, it shows an object with ‘target: Graphics’, and logging the object’s given name shows ‘bg’. But on opening the event object, it shows an object with ‘target: Container’ and a name of ‘stage’ (the parent container). I have each event logging two things, the name, and the object. Open the object.target and you can see the name is different inside.
  • If I remove line 32 (stage.interactive = true), then the logging of objects shows up as expected. Both the object overview and the individual items in the object show both ‘target: Graphics’ and ‘name: “bg”’.
  1. The red box’s ‘over’ event fires the first time this fiddle is run even though the mouse is not over the red box.

  2. The red box’s ‘out’ event fires the first time the mouse moves into the canvas area even though the mouse was never over the red box. (This is most likely because the ‘over’ event was incorrectly fired so it probably thinks the mouse is over the red box to begin with.)

  3. Right clicking causes the ‘over’ and ‘out’ events to fire when the right click content box shows up. Expectation: is that the context box is not part of the canvas and should not trigger events.

@endel
Copy link
Contributor

endel commented Jun 16, 2015

Also related with #1837, #1884 and #1891

There is a patch/pull-request for this here: #1894

@englercj englercj added 🕷 Bug Verified that it’s actually a legit bug that exists in the current release. Interaction Manager labels Jul 7, 2015
@stephenweaver
Copy link

added a comment to the PR #1894
this issues is not resolved with that fix. I think if we can figure out why targetTouches includes all touches on the canvas rather than just the pixi object, the events will get sent to the correct objects. maybe?

@englercj
Copy link
Member

Is this issue still active on latest v4 dev?

@englercj englercj added 💾 v4.x (Legacy) Legacy version 4 support 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. Domain: API 🔍 Needs Investigation Issue needs to be research or investigated further. labels Sep 27, 2016
@hubletkoresh
Copy link

Definitely still there, and it seems worse: because the events now appear to fire regardless of whether I am actually hovering over the element or not: http://jsfiddle.net/ar4pjetx/15/

@staff0rd
Copy link
Collaborator

@hubletkoresh that particular functionality can be switched with;

renderer.plugins.interaction.moveWhenInside = true;

If there is another non-interactive graphic on top of the red box and the red box's parent container has set ‘interactive = true', the red box no longer responds to events where the green box is overlapping, i.e., when mousing over both boxes, if the green box is present, then the red box thinks that the mouse is no longer over it. My expectation is that the box events should not be blocked by a non-interactive object on top of it. This is how v2 worked.

If I remove line 32 (stage.interactive = true), then the events fire as expected.

Still occurs in v4

When logging events in Chrome, it shows an object with ‘target: Graphics’, and logging the object’s given name shows ‘bg’. But on opening the event object, it shows an object with ‘target: Container’ and a name of ‘stage’ (the parent container). I have each event logging two things, the name, and the object. Open the object.target and you can see the name is different inside.

No longer occurs

The red box’s ‘over’ event fires the first time this fiddle is run even though the mouse is not over the red box.

No longer occurs

The red box’s ‘out’ event fires the first time the mouse moves into the canvas area even though the mouse was never over the red box. (This is most likely because the ‘over’ event was incorrectly fired so it probably thinks the mouse is over the red box to begin with.)

No longer occurs

Right clicking causes the ‘over’ and ‘out’ events to fire when the right click content box shows up. Expectation: is that the context box is not part of the canvas and should not trigger events.

No longer occurs

@megakoresh
Copy link

@staff0rd thanks, but... How on earth do you find these things? Is there another documentation for this library that is actually complete?

@themoonrat
Copy link
Member

Hi @megakoresh - The documentation for interaction can be found http://pixijs.download/release/docs/PIXI.interaction.html - but it seems that some of the docs aren't showing up, and some do need more added and clarification. You can click through to see the code on those pages, and thus see what is actually there, rather than just what the docs are outputting. Contributions to improve docs are always very welcome!

@staff0rd
Copy link
Collaborator

@megakoresh @themoonrat It seems that specific property was additionally marked @private. I've opened PR #3471 to expose it.

@megakoresh
Copy link

@themoonrat It appears that the docs are autogenerated. I don't see how I could open a PR to help improve them.

@themoonrat
Copy link
Member

Docs are generated from special comments written in the source code - documentation for which is at http://usejsdoc.org
So it's a PR just like any other :)

@megakoresh
Copy link

megakoresh commented Dec 16, 2016

Ok I am not familiar with this. Maybe I can try to improve the docs for this library if I find things like that moveWhenInside.

@staff0rd
Copy link
Collaborator

Last unsolved issue specific to OP has been moved to #3596. Closing this, let me know if anyone thinks there's still any outstanding items.

@lock
Copy link

lock bot commented Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕷 Bug Verified that it’s actually a legit bug that exists in the current release. 🥶 Low Priority Generally issues or PRs that don’t need to make it into the next release. 🔍 Needs Investigation Issue needs to be research or investigated further. 💾 v4.x (Legacy) Legacy version 4 support
Projects
None yet
Development

No branches or pull requests

8 participants