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

Browser zooms cause issues with mouse xy positions #1048

Open
HiveTechDev opened this issue May 21, 2024 · 4 comments
Open

Browser zooms cause issues with mouse xy positions #1048

HiveTechDev opened this issue May 21, 2024 · 4 comments

Comments

@HiveTechDev
Copy link

Some browser's zoom behavior makes the x/y mouse position thrown off. When programmatically changing the zoom it looks like the canvas offset gets thrown off of the x/y and will cause hover and button clicks to be left/right depending on the zoom amount.

You can see this on any of the demos.

  1. https://dygraphs.com/tutorial.html
  • in console enter: document.body.style.zoom = "80%"
  • You can see this with any of the demos
  1. Chrome, if zoom is done programmatically with the above. Older IE browsers.
  2. 2.2.1 - But again, whats live on website.

If there is a workaround for this, would be great.

@HiveTechDev
Copy link
Author

image

@mirabilos
Copy link
Collaborator

mirabilos commented May 21, 2024 via email

@HiveTechDev
Copy link
Author

This happens on older IE versions as well as some Firefox. If you mash ctrl +/- with chrome this will happen sometimes as well. It's hard to get it in that state but I have a couple of times.

This snippet was to force the case in which you can see it but it is also used by some other libraries and chrome plugins (not that I can control what everyone does for zoom).

Other libraries do support zooming. Thought it would be an issue to bring up.

@mirabilos
Copy link
Collaborator

mirabilos commented May 22, 2024 via email

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

No branches or pull requests

2 participants