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.
Trait Implementations§
source§impl Debug for ScrollTree
impl Debug for ScrollTree
source§impl Default for ScrollTree
impl Default for ScrollTree
source§fn default() -> ScrollTree
fn default() -> ScrollTree
source§impl<'de> Deserialize<'de> for ScrollTree
impl<'de> Deserialize<'de> for ScrollTree
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ScrollTree
impl RefUnwindSafe for ScrollTree
impl Send for ScrollTree
impl Sync for ScrollTree
impl Unpin for ScrollTree
impl UnwindSafe for ScrollTree
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more