[w3c/pointerlock] movementX/Y when zoom in/out (#23)

movementX/Y properties is defined as movementX = eNow.screenX-ePrevious.screenX in the spec.  

Try this [test page](http://scheib.github.com/HTMLMisc/PointerLockAndFullscreen.html).
Zoom in on the page, click on the pink box to align the system cursor and the HTMLCursor. Moving mouse around without having the mouse locked, the HTML cursor will have more movement than the pointer.

The behavior is odd but it is the expected result, because HTML cursor is displayed on client coordinate but movement is on screen coordinate. 
Chrome, Edge, safari have same behavior. 

However, Firefox have movementX/Y calculated by difference in client coordinates. The cursors will remain aligned when mouse move on zoomed page.

Although this may not be a common use case of movementX/Y, but what should be the right behavior of movementX/Y? Firefox’s implement make more sense to me. The movementX/Y properties should reflect the pointer movement in client coordinates. 

Is there any reason to use screenX/Y? Should we have movementX/Y calculated base on clientX/Y instead of screenX/Y?  


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/pointerlock/issues/23

Received on Thursday, 29 June 2017 22:01:13 UTC