state_from_pointer_event

Function state_from_pointer_event 

Source
pub fn state_from_pointer_event(
    e: &PointerEvent,
    scale_factor: f64,
) -> PointerState
Expand description

Build a PointerState from a DOM web_sys::PointerEvent.

  • Coordinates use clientX/Y scaled by scale_factor to approximate physical pixels.
  • Uses the event’s reported pressure, tangentialPressure, width/height, and stylus orientation where available (preferring altitudeAngle/azimuthAngle, otherwise falling back to tiltX/tiltY).
  • Pointer Events twist is not currently mapped (there is no corresponding field in ui-events).