pub enum Inclusivity {
SelfAndAncestors,
AncestorsOnly,
}Expand description
Whether a tree walk starts at the node itself or at its parent.
Five different ancestor walks in this codebase encoded this choice in a
loop’s starting value, so the difference between “the caret’s own scroll
box” and “the scroll box around it” was invisible at the call site — and
the two mirror-image helper pairs (accumulated_scroll_for_node vs
node_rect_to_screen, find_scrollable_ancestor vs find_scroll_parent)
had names that gave no hint which was which.
Variants§
SelfAndAncestors
Start at the node itself. Correct when the node’s own scrolling is part of the answer: how far this box’s content has moved, or which box a caret inside it lives in.
AncestorsOnly
Start at the node’s parent. Correct when the answer is about where the node’s BOX sits, or which OTHER container should take over: a container’s own scrolling never moves its own box, and momentum must chain outwards, not back into itself.
Implementations§
Source§impl Inclusivity
impl Inclusivity
Sourcepub const fn includes_self(self) -> bool
pub const fn includes_self(self) -> bool
Whether the walk visits the starting node.
Trait Implementations§
Source§impl Clone for Inclusivity
impl Clone for Inclusivity
Source§fn clone(&self) -> Inclusivity
fn clone(&self) -> Inclusivity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more