Struct webrender_traits::display_list::ScrollTree
source · pub struct ScrollTree {
pub nodes: Vec<ScrollTreeNode>,
}
Expand description
A tree of spatial nodes, which mirrors the spatial nodes in the WebRender display list, except these are used to scrolling in the compositor so that new offsets can be sent to WebRender.
Fields§
§nodes: Vec<ScrollTreeNode>
A list of compositor-side scroll nodes that describe the tree of WebRender spatial nodes, used by the compositor to scroll the contents of the display list.
Implementations§
source§impl ScrollTree
impl ScrollTree
sourcepub fn add_scroll_tree_node(
&mut self,
parent: Option<&ScrollTreeNodeId>,
spatial_id: SpatialId,
scroll_info: Option<ScrollableNodeInfo>,
) -> ScrollTreeNodeId
pub fn add_scroll_tree_node( &mut self, parent: Option<&ScrollTreeNodeId>, spatial_id: SpatialId, scroll_info: Option<ScrollableNodeInfo>, ) -> ScrollTreeNodeId
Add a scroll node to this ScrollTree returning the id of the new node.
sourcepub fn get_node_mut(&mut self, id: &ScrollTreeNodeId) -> &mut ScrollTreeNode
pub fn get_node_mut(&mut self, id: &ScrollTreeNodeId) -> &mut ScrollTreeNode
Get a mutable reference to the node with the given index.
sourcepub fn get_node(&mut self, id: &ScrollTreeNodeId) -> &ScrollTreeNode
pub fn get_node(&mut self, id: &ScrollTreeNodeId) -> &ScrollTreeNode
Get an immutable reference to the node with the given index.
sourcepub fn scroll_node_or_ancestor(
&mut self,
scroll_node_id: &ScrollTreeNodeId,
scroll_location: ScrollLocation,
) -> Option<(ExternalScrollId, LayoutVector2D)>
pub fn scroll_node_or_ancestor( &mut self, scroll_node_id: &ScrollTreeNodeId, scroll_location: ScrollLocation, ) -> Option<(ExternalScrollId, LayoutVector2D)>
Scroll the given scroll node on this scroll tree. If the node cannot be scrolled, because it isn’t a scrollable node or it’s already scrolled to the maximum scroll extent, try to scroll an ancestor of this node. Returns the node scrolled and the new offset if a scroll was performed, otherwise returns None.
sourcepub fn set_scroll_offsets_for_node_with_external_scroll_id(
&mut self,
external_scroll_id: ExternalScrollId,
offset: LayoutVector2D,
) -> bool
pub fn set_scroll_offsets_for_node_with_external_scroll_id( &mut self, external_scroll_id: ExternalScrollId, offset: LayoutVector2D, ) -> bool
Given an ExternalScrollId
and an offset, update the scroll offset of the scroll node
with the given id.