Re: [w3c/pointerlock] movementX/Y coordinate space (#42)

Here is one more suggestion to deal with the situation from an API user perspective.

I'm implementing a slider/knob, that can be adjusted by dragging. For the adjustment during dragging, the distance traveled in clientX/Y coordinates can be used.
But when pointer lock is enganged during dragging, the movementX/Y coordinates have to be used instead. The obvious expectation here would be for movementX/Y to match the clientX/Y coordinate space. This seems to work on FF-77 but not Chrome-83 with devicePixelRatio=2. So the idea is:

4. **Modify `movementX/Y` to CSS to match `clientX/Y` (or `pageX/Y`) coordinate space**, this needs a wording correction of the PointerLock spec.
        (i) Chrome would have to be fixed to match Firefox' calculations.
        (ii) Changing the `screenX/Y` spec has no effects on `movementX/Y`.

Alternatively, movementX/Y could be documented/speced to always be scaled up by devicePixelRatio and FF would need fixing. But that doesn't seem to be consistent with any other coordinate pair exposed by the mouse/pointer events. Related [crbug#1092358](https://bugs.chromium.org/p/chromium/issues/detail?id=1092358).

-- 
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/42#issuecomment-640526915

Received on Monday, 8 June 2020 10:48:21 UTC