pub struct ScrollPosition {
pub parent_rect: LogicalRect,
pub children_rect: LogicalRect,
}Expand description
Information about a scroll frame, given to the user by the framework.
The two rects are NOT in the same coordinate space — never subtract one
origin from the other. That silent ambiguity put the scrollbar thumb
partway down the track for every container not at the window origin.
See ScrollManager::get_scroll_states_for_dom for the producer.
Fields§
§parent_rect: LogicalRectThe scroll container’s border box in ABSOLUTE window coordinates.
size is the scrollport (“how big is the parent container”, so
“scroll to left edge” can be implemented); origin is where that
container sits on screen and is only meaningful to scroll-into-view.
children_rect: LogicalRectsize = the scrollable content (“the union of all children”, or the
VirtualView virtual size when one was reported).
origin = the SCROLL OFFSET ITSELF — distance already scrolled from
the scroll origin, normally clamped to [0, content − container].
It is NOT an absolute position and NOT relative to
parent_rect.origin; content paints at position − origin.
Trait Implementations§
Source§impl Clone for ScrollPosition
impl Clone for ScrollPosition
Source§fn clone(&self) -> ScrollPosition
fn clone(&self) -> ScrollPosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more