pub struct PageSnap {
pub extent: f32,
pub count: usize,
pub requested: usize,
pub horizontal: bool,
pub snapping: bool,
}Expand description
How a scrollable snaps to pages, as the shell and the runtime see it.
This is what turns an ordinary scroll region into a paged one: it travels on
the region’s crate::Scrollable description, so the release path can ask
“is this area paged?” without knowing anything about the widget.
Fields§
§extent: f32Distance from one page to the next, in logical pixels.
count: usizeHow many pages there are.
requested: usizeThe page the application is asking for, applied on the first frame and on
every change; see PageView::page.
horizontal: boolDoes the view page sideways?
snapping: boolDoes a release come to rest on a page?
False and the region flings like any other scroll, which is what a
free-running carousel wants. The rest of the paged machinery stays: the
page a reader would name is still reported, and a requested page still
glides. Only the release changes. See PageView::page_snapping.