Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
Mouse event's movementX and movementY showing different values in two machines, both with same device pixel ratio. How come?

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?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!