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

Resizer doubles movement #1

Closed
mjschurig opened this issue Aug 25, 2021 · 2 comments
Closed

Resizer doubles movement #1

mjschurig opened this issue Aug 25, 2021 · 2 comments

Comments

@mjschurig
Copy link
Contributor

mjschurig commented Aug 25, 2021

I encountered an issue with the resizer component. I use Windows 10 with Chrome Canary. My Windows display settings are set to 4k with the recommended scaling factor of 300%. This leads to three times more resizing as the mouse movements sugests. This issue can be fixed by replacing lines 11 to 15 in the resizer index.js with the following:

const ratio = window.devicePixelRatio
const handleMouseMove = (e) => {
if (!direction) return
onResize(direction, e.movementX/ratio, e.movementY/ratio)
}

This scales the movement by the display scaling factor, leading to the correct resizing operation.

Confer to: w3c/uievents#40

@nmingaleev
Copy link
Owner

That's a great point! I didn't know about it. Could please submit a pull request?

@mjschurig
Copy link
Contributor Author

Done

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