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

Wrong events x / y values when not hovering the sigma instance #1169

Closed
jacomyal opened this issue Nov 26, 2021 · 0 comments
Closed

Wrong events x / y values when not hovering the sigma instance #1169

jacomyal opened this issue Nov 26, 2021 · 0 comments
Labels
Milestone

Comments

@jacomyal
Copy link
Owner

I am developing an application where the sigma container has panels around. In this app, nodes are draggable, using a code very similar to the one in the mouse-manipulations example.

Since the v2.1.0, users can drag the node, even when the mouse leaves the container, thanks to the #1148 fix.
But now, when the mouse leaves the container, the nodes are no more under the mouse, because the x and y positions in the event depend on what's under the mouse, basically.

The solution is to stop using the getX and getY positions, and instead always use the better offset method.

@jacomyal jacomyal added the bug label Nov 26, 2021
@jacomyal jacomyal modified the milestones: v2.2.0, v2.1.2 Nov 26, 2021
jacomyal added a commit that referenced this issue Nov 29, 2021
Details:
- Updates mouse-manipulations example so that it features a sigma
container in a draggable page (to make it easier to test d-n-d code as
well as zooming in a graph in a scrolled webpage)
- Removes getX and getY helpers
- Makes `dom` a required argument in the getPosition helper, and adapts
all calls to this helper everywhere in the codebase
- Replaces pageX and pageY with clientX and clientY in getPosition (to
fix it)

This commit fixes issues #1175 and #1169.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant