pub struct ScrollMetrics {
pub pixels: f64,
pub min_scroll_extent: f64,
pub max_scroll_extent: f64,
pub viewport_dimension: f64,
pub device_pixel_ratio: f64,
}Expand description
A read-only snapshot of a scroll surface’s extent/position, the argument
every ScrollPhysics method reasons over (Flutter’s ScrollMetrics).
min_scroll_extent is carried for parity/chaining even though frust’s
scroll surfaces always run it at 0.0 today — nothing in this crate
produces a nonzero value yet.
Fields§
§pixels: f64The current scroll position (px scrolled down/along the axis).
min_scroll_extent: f64The minimum in-range position. Always 0.0 in this crate today.
max_scroll_extent: f64The maximum in-range position (content − viewport, never negative).
viewport_dimension: f64The visible extent along the scroll axis.
device_pixel_ratio: f64The device’s logical-to-physical pixel scale, feeding
Tolerance::for_device_pixel_ratio.
Implementations§
Source§impl ScrollMetrics
impl ScrollMetrics
Sourcepub fn out_of_range(&self) -> bool
pub fn out_of_range(&self) -> bool
Whether pixels currently sits outside [min_scroll_extent, max_scroll_extent].
Sourcepub fn overscroll_past_leading(&self) -> f64
pub fn overscroll_past_leading(&self) -> f64
How far past the leading (top/start) edge pixels currently sits,
0.0 if not past it.
Sourcepub fn overscroll_past_trailing(&self) -> f64
pub fn overscroll_past_trailing(&self) -> f64
How far past the trailing (bottom/end) edge pixels currently sits,
0.0 if not past it.