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.