pub struct ScrollTo {
pub x: Option<ScrollTarget>,
pub y: Option<ScrollTarget>,
pub animate: bool,
}Expand description
A request to move a scroll region, addressed to one axis or both.
None on an axis leaves that axis where it is, which is what lets one type serve a
vertical page, a sideways strip and the rare surface that scrolls both ways without a
caller ever writing a coordinate it did not mean.
Carried by a command, resolved against the frame that follows it, and refused by a region a finger is holding — an offset has one owner at a time, and the finger is the one the reader can see.
Fields§
§x: Option<ScrollTarget>Where the horizontal axis is asked to go; None leaves it alone.
y: Option<ScrollTarget>Where the vertical axis is asked to go; None leaves it alone.
animate: boolSpring to it (what every constructor here sets) rather than arrive there.
Implementations§
Source§impl ScrollTo
impl ScrollTo
Sourcepub fn and_x(self, target: ScrollTarget) -> Self
pub fn and_x(self, target: ScrollTarget) -> Self
Also moves the horizontal axis to target.
Sourcepub fn and_y(self, target: ScrollTarget) -> Self
pub fn and_y(self, target: ScrollTarget) -> Self
Also moves the vertical axis to target.
Sourcepub fn instant(self) -> Self
pub fn instant(self) -> Self
Arrive rather than travel: no animation, the offset is simply there.
What restoring a reader’s place wants. An animation there would be a list scrolling itself in front of somebody who has just come back and is looking for where they left off, and the reference draws the same line between its two verbs.