Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda