pub enum WheelDelta {
Pixels(PixelsVector),
Lines(LinesVector),
Pages(PagesVector),
}Expand description
Variants§
Pixels(PixelsVector)
Movement in Pixels
Lines(LinesVector)
Movement in Lines
Pages(PagesVector)
Movement in Pages
Implementations§
Source§impl WheelDelta
impl WheelDelta
Sourcepub fn pixels(x: f64, y: f64, z: f64) -> Self
pub fn pixels(x: f64, y: f64, z: f64) -> Self
Convenience function for constructing a WheelDelta with pixel units
Sourcepub fn lines(x: f64, y: f64, z: f64) -> Self
pub fn lines(x: f64, y: f64, z: f64) -> Self
Convenience function for constructing a WheelDelta with line units
Sourcepub fn pages(x: f64, y: f64, z: f64) -> Self
pub fn pages(x: f64, y: f64, z: f64) -> Self
Convenience function for constructing a WheelDelta with page units
Sourcepub fn is_zero(&self) -> bool
pub fn is_zero(&self) -> bool
Returns true iff there is no wheel movement
i.e. the x, y and z delta is zero (disregarding units)
Sourcepub fn strip_units(&self) -> Vector3D<f64, UnknownUnit>
pub fn strip_units(&self) -> Vector3D<f64, UnknownUnit>
A Vector3D proportional to the amount scrolled
Note that this disregards the 3 possible units: this could be expressed in terms of pixels, lines, or pages.
In most cases, to properly handle scrolling, you should handle all 3 possible enum variants instead of stripping units. Otherwise, if you assume that the units will always be pixels, the user may experience some unexpectedly slow scrolling if their mouse/OS sends values expressed in lines or pages.
Trait Implementations§
Source§impl Clone for WheelDelta
impl Clone for WheelDelta
Source§fn clone(&self) -> WheelDelta
fn clone(&self) -> WheelDelta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more