Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

246
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda