I have a drag and drop system in which users can drag and element and that dragging should, of course, match the mouse movement. To update the element's position, I use the mouse move events's movementX
and movementY
properties.
It turns out that in one machine it works great as is. I just use the values coming from movementX
and movementY
without adjusting for the window.devicePixelRatio
and the dragging matches the mouse movement.
On another machine I need to divide movementX
and movementY
by window.devicePixelRatio
to get the movement to match the mouse pointer on the screen.
Both machines report a window.devicePixelRatio
value of 2.
My question is: what other variable is at play here? Both machines are using the same application. How can in one application the dragging match while in the other it require's adjustment if both have the same devicePixelRatio?
We're both on Google Chrome 100, on a Mac.
What am I missing?