Skip to content

Commit

Permalink
Fix documentation of dirty and mark_dirty functions (#724)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoburns authored Oct 22, 2024
1 parent 84ab995 commit af780e2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/tree/taffy_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ impl NodeData {
}
}

/// Marks a node and all of its parents (recursively) as dirty
/// Marks a node and all of its ancestors as requiring relayout
///
/// This clears any cached data and signals that the data must be recomputed.
#[inline]
Expand Down Expand Up @@ -710,11 +710,9 @@ impl<NodeContext> TaffyTree<NodeContext> {
}
}

/// Marks the layout computation of this node and its children as outdated
/// Marks the layout of this node and its ancestors as outdated
///
/// Performs a recursive depth-first search up the tree until the root node is reached
///
/// WARNING: this will stack-overflow if the tree contains a cycle
/// WARNING: this may stack-overflow if the tree contains a cycle
pub fn mark_dirty(&mut self, node: NodeId) -> TaffyResult<()> {
/// WARNING: this will stack-overflow if the tree contains a cycle
fn mark_dirty_recursive(
Expand All @@ -734,7 +732,7 @@ impl<NodeContext> TaffyTree<NodeContext> {
Ok(())
}

/// Indicates whether the layout of this node (and its children) need to be recomputed
/// Indicates whether the layout of this node needs to be recomputed
pub fn dirty(&self, node: NodeId) -> TaffyResult<bool> {
Ok(self.nodes[node.into()].cache.is_empty())
}
Expand Down

0 comments on commit af780e2

Please sign in to comment.