8000 [Issue-18] fix mouse position by hkang1 · Pull Request #20 · hkang1/hermes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Issue-18] fix mouse position #20

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

Merged
merged 4 commits into from
Feb 19, 2022
Merged

[Issue-18] fix mouse position #20

merged 4 commits into from
Feb 19, 2022

Conversation

hkang1
Copy link
Owner
@hkang1 hkang1 commented Feb 19, 2022

PROBLEM
The mouse interactions are off by some offset. The issue is that the mouse position is relative to the viewport and not the chart element itself. This is partly because the mousemove and mouseup are listening from the window and not the chart element to provide better drag and drop flexibility.

SOLUTION
Adjust mouse event positions to take element position (via getBoundingClientRect) into account.

@hkang1 hkang1 linked an issue Feb 19, 2022 that may be closed by this pull request
@hkang1 hkang1 merged commit 4de3a2a into main Feb 19, 2022
@hkang1 hkang1 deleted the 18-fix-mouse-position branch February 19, 2022 07:00
@hkang1 hkang1 linked an issue Feb 21, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mouse positions are off when the chart is not rendered at (0, 0)
1 participant
0