pub struct ScrollSample {
pub delta: ScrollDelta,
pub position: Option<Point>,
pub phase: ScrollPhase,
pub source: ScrollSource,
pub pointer: PointerInfo,
pub modifiers: Modifiers,
}Expand description
One scroll sample as it enters the tree.
The unit WidgetTree::dispatch_scroll
consumes.
Fields§
§delta: ScrollDeltaHow far to scroll, in lines or pixels.
position: Option<Point>Where the pointer was, in window-logical coordinates, when the scroll happened.
Some routes the scroll by hit test; None falls back to the hovered
(else focused) widget. A wheel event has historically been None and
stays that way, so a mouse routes exactly as before; a synthesised touch
pan must carry a position, because a contact never writes hover and
would otherwise route nowhere.
phase: ScrollPhaseWhere in a continuous gesture this sample sits.
source: ScrollSourceWhat produced it.
pointer: PointerInfoWho is pointing.
modifiers: ModifiersModifier keys held when the sample was produced. Ctrl-wheel-to-zoom reads this.
Implementations§
Source§impl ScrollSample
impl ScrollSample
Sourcepub fn wheel(delta: ScrollDelta, modifiers: Modifiers, time: EventTime) -> Self
pub fn wheel(delta: ScrollDelta, modifiers: Modifiers, time: EventTime) -> Self
A discrete wheel notch from the mouse, routed by hover — exactly what
WidgetEvent::Scroll meant before the touch programme.