pub struct NativeTouchPointF64 {
pub identifier: i32,
pub client_x: f64,
pub client_y: f64,
pub screen_x: f64,
pub screen_y: f64,
pub offset_x: f64,
pub offset_y: f64,
pub page_x: f64,
pub page_y: f64,
}Expand description
Represents a single touch point with high-precision f64 coordinates.
Used for pixel-precise interactions such as canvas drawing, where
sub-pixel accuracy matters. The identifier field distinguishes
between simultaneous touch points, enabling multi-finger gesture
tracking.
Fields§
§identifier: i32A unique identifier for this touch point.
client_x: f64The X coordinate of the touch relative to the viewport.
client_y: f64The Y coordinate of the touch relative to the viewport.
screen_x: f64The X coordinate of the touch relative to the screen.
screen_y: f64The Y coordinate of the touch relative to the screen.
offset_x: f64The X coordinate of the touch relative to the target element.
offset_y: f64The Y coordinate of the touch relative to the target element.
page_x: f64The X coordinate of the touch relative to the page.
page_y: f64The Y coordinate of the touch relative to the page.
Implementations§
Source§impl NativeTouchPointF64
Implementation of high-precision touch point extraction from DOM touch events.
impl NativeTouchPointF64
Implementation of high-precision touch point extraction from DOM touch events.
Sourcepub fn extract_all(event: &Event) -> Vec<NativeTouchPointF64>
pub fn extract_all(event: &Event) -> Vec<NativeTouchPointF64>
Extracts all active touch points with high-precision f64 offset coordinates
from a TouchEvent.
Similar to NativeTouchPoint::extract_all, but returns f64 precision for
offset/client coordinates, which is essential for canvas drawing
and other pixel-precise interactions.
Uses web-sys typed getters (TouchEvent::touches(),
TouchList::get, Touch::client_x()) instead of
Reflect::get(event, "clientX"). web-sys Touch exposes
client_x/page_x/etc. as i32; we widen to f64 to preserve
the NativeTouchPointF64 high-precision contract without losing
sub-pixel information on the offset computation.
§Arguments
&Event- The native DOM touch event.
§Returns
Vec<NativeTouchPointF64>- All currently active touch points withf64coordinates.