pub enum ScrollDelta {
Lines {
x: f32,
y: f32,
},
Pixels {
x: f64,
y: f64,
},
}Expand description
How far a scroll event moved, in the units the device reported.
The two variants are not interchangeable and must not be collapsed by the shell: a notched wheel genuinely reports discrete clicks, a touchpad genuinely reports pixels, and the conversion factor between them is a policy decision (how many pixels is one line?) that belongs to the action layer and the UI, where it can be configured, not to a backend.
Variants§
Lines
Discrete detents — y positive scrolls the content up (away from the
user), matching every platform’s convention for a wheel.
Pixels
Continuous motion in physical pixels, from a touchpad or high-resolution
wheel. Same sign convention as ScrollDelta::Lines.
Implementations§
Trait Implementations§
Source§impl Clone for ScrollDelta
impl Clone for ScrollDelta
impl Copy for ScrollDelta
Source§impl Debug for ScrollDelta
impl Debug for ScrollDelta
Source§impl PartialEq for ScrollDelta
impl PartialEq for ScrollDelta
impl StructuralPartialEq for ScrollDelta
Auto Trait Implementations§
impl Freeze for ScrollDelta
impl RefUnwindSafe for ScrollDelta
impl Send for ScrollDelta
impl Sync for ScrollDelta
impl Unpin for ScrollDelta
impl UnsafeUnpin for ScrollDelta
impl UnwindSafe for ScrollDelta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more