pub enum ScrollDelta {
Lines {
x: f32,
y: f32,
},
Pixels {
x: f64,
y: f64,
},
}Expand description
Input vocabulary, defined in crcbl_core::input and re-exported so a
consumer of the event stream needs one use rather than two.
See the crate docs for why these live in crcbl-core.
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
Source§fn clone(&self) -> ScrollDelta
fn clone(&self) -> ScrollDelta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more