#[non_exhaustive]pub struct CoalescedSample {
pub time: EventTime,
pub window_position: Point,
pub axes: PointerAxes,
}Expand description
One position the OS batched into a packet, with the axes it was sampled at and its own time.
A backend that reports a batch — a digitizer whose packets arrive faster
than the window’s message rate, a platform with an explicit coalescing API —
hands over one PointerSample per packet with the intermediate
positions in PointerSample::coalesced. The alternative, one whole tree
dispatch per digitizer packet, costs a hit test, an arbitration turn and a
handler walk for a position no one had a chance to draw between.
Consumers see these through
EventContext::coalesced. A drawing
surface fans out over them and then over the sample’s own position; a
velocity tracker integrates them; everything else ignores them, which costs
nothing because the list is empty for every producer that does not batch.
§Coordinates
window_position is window-logical, exactly
like PointerSample::position and
WidgetEvent::Scroll’s window_position, and is
named for it. The router localises the event’s position against the
captor’s current bounds; a batch has no single widget to localise against,
and a handler that needs widget-local coordinates converts at the use site
— a SceneView does it through SceneView::view_transform_signal.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.time: EventTimeWhen the device produced this position, on the tree’s timeline.
window_position: PointWhere, in window-logical coordinates. See the type’s docs.
axes: PointerAxesThe continuous axes as they read at this position — a digitizer varies pressure and tilt within a batch, and that variation is the whole reason to keep the intermediate samples rather than the endpoints.
Implementations§
Trait Implementations§
Source§impl Clone for CoalescedSample
impl Clone for CoalescedSample
Source§fn clone(&self) -> CoalescedSample
fn clone(&self) -> CoalescedSample
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more