Skip to content

Commit

Permalink
Clean up the comments for the clipping rects update function which re…
Browse files Browse the repository at this point in the history
…ference `Overflow` variants that no longer exist.
  • Loading branch information
ickshonpe committed Feb 10, 2025
1 parent 232824c commit c95ee1e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions crates/bevy_ui/src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,10 @@ fn update_clipping(

// Calculate new clip rectangle for children nodes
let children_clip = if node.overflow.is_visible() {
// When `Visible`, children might be visible even when they are outside
// the current node's boundaries. In this case they inherit the current
// node's parent clip. If an ancestor is set as `Hidden`, that clip will
// be used; otherwise this will be `None`.
// The current node doesn't clip, propagate the optional inherited clipping rect to any children
maybe_inherited_clip
} else {
// If `maybe_inherited_clip` is `Some`, use the intersection between
// current node's clip and the inherited clip. This handles the case
// of nested `Overflow::Hidden` nodes. If parent `clip` is not
// defined, use the current node's clip.

// Find the current node's clipping rect and intersect it with the inherited clipping rect, if one exists
let mut clip_rect = Rect::from_center_size(
global_transform.translation().truncate(),
computed_node.size(),
Expand Down

0 comments on commit c95ee1e

Please sign in to comment.