Enum dioxus_html::geometry::WheelDelta
source · pub enum WheelDelta {
Pixels(PixelsVector),
Lines(LinesVector),
Pages(PagesVector),
}
Expand description
A vector representing the amount the mouse wheel was moved
This may be expressed in Pixels, Lines or Pages
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 (disregards 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