pub struct AutoScroll {
pub edge_px: f64,
pub max_px_per_s: f64,
}Expand description
How an auto_scroll_zone() scrolls: the edge band’s depth and the speed
at the edge.
Fields§
§edge_px: f64Depth of the band inside the top and bottom edges that scrolls, in
logical px (default AUTO_SCROLL_EDGE_PX). Zero, negative or
non-finite disables auto-scroll.
max_px_per_s: f64Speed at the edge itself, in logical px per second (default
AUTO_SCROLL_MAX_PX_PER_S); it falls off linearly to zero at the
band’s inner boundary. Zero, negative or non-finite disables
auto-scroll.
Implementations§
Source§impl AutoScroll
impl AutoScroll
Sourcepub fn velocity(&self, zone: Rect, pointer: Point) -> f64
pub fn velocity(&self, zone: Rect, pointer: Point) -> f64
The scroll velocity, in px per second (negative toward the top), for a
pointer at pointer over a zone whose window-space bounds are zone.
Zero outside zone and outside both edge bands. Inside a band the speed
is max_px_per_s × depth / edge_px, depth being how far past the
band’s inner boundary the pointer is. A zone shorter than two bands has
them overlap; the nearer edge wins.
Trait Implementations§
Source§impl Clone for AutoScroll
impl Clone for AutoScroll
Source§fn clone(&self) -> AutoScroll
fn clone(&self) -> AutoScroll
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for AutoScroll
Source§impl Debug for AutoScroll
impl Debug for AutoScroll
Source§impl Default for AutoScroll
impl Default for AutoScroll
Source§fn default() -> AutoScroll
fn default() -> AutoScroll
Source§impl PartialEq for AutoScroll
impl PartialEq for AutoScroll
impl StructuralPartialEq for AutoScroll
Auto Trait Implementations§
impl Freeze for AutoScroll
impl RefUnwindSafe for AutoScroll
impl Send for AutoScroll
impl Sync for AutoScroll
impl Unpin for AutoScroll
impl UnsafeUnpin for AutoScroll
impl UnwindSafe for AutoScroll
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.