pub struct WheelScroll {
pub delta: Point,
pub modifiers: Modifiers,
pub uptime_millis: u64,
}Expand description
A mouse-wheel or trackpad scroll sample ready for
AppShell::wheel_scrolled.
Fields§
§delta: PointScroll amount in logical pixels; positive moves content down and right (see the module docs — this is winit’s sign, not the DOM’s).
modifiers: ModifiersKeyboard modifiers held during the sample. ctrl makes it a zoom
gesture, alt turns a vertical wheel into a horizontal scroll.
uptime_millis: u64Monotonic milliseconds, for the rotary event’s velocity tracking. Only differences between samples are meaningful.
Implementations§
Source§impl WheelScroll
impl WheelScroll
Sourcepub fn with_modifiers(self, modifiers: Modifiers) -> Self
pub fn with_modifiers(self, modifiers: Modifiers) -> Self
This sample with modifiers held.
Sourcepub fn is_zoom(&self) -> bool
pub fn is_zoom(&self) -> bool
Whether this sample is the zoom gesture (ctrl+wheel, which is also how trackpad pinches arrive in a browser) rather than a scroll.
Sourcepub fn zoom_factor(&self) -> f32
pub fn zoom_factor(&self) -> f32
The multiplicative zoom step for a ctrl+wheel sample: one notch up
(positive delta) zooms in by [ZOOM_PER_NOTCH].
Sourcepub fn scroll_delta(&self) -> Point
pub fn scroll_delta(&self) -> Point
The delta the hovered scrollable should see: with alt held, a vertical wheel drives the horizontal axis instead (the shift-less way to scroll a row on a wheel that only has a vertical axis).
Trait Implementations§
Source§impl Clone for WheelScroll
impl Clone for WheelScroll
Source§fn clone(&self) -> WheelScroll
fn clone(&self) -> WheelScroll
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more