Skip to content

Commit 359cd43

Browse files
authored
UI clipping update function comments fix (#17785)
# Objective Fix for the comments for the clipping rects update function which references `Overflow` variants that no longer exist.
1 parent f27e00b commit 359cd43

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

crates/bevy_ui/src/update.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,10 @@ fn update_clipping(
8787

8888
// Calculate new clip rectangle for children nodes
8989
let children_clip = if node.overflow.is_visible() {
90-
// When `Visible`, children might be visible even when they are outside
91-
// the current node's boundaries. In this case they inherit the current
92-
// node's parent clip. If an ancestor is set as `Hidden`, that clip will
93-
// be used; otherwise this will be `None`.
90+
// The current node doesn't clip, propagate the optional inherited clipping rect to any children
9491
maybe_inherited_clip
9592
} else {
96-
// If `maybe_inherited_clip` is `Some`, use the intersection between
97-
// current node's clip and the inherited clip. This handles the case
98-
// of nested `Overflow::Hidden` nodes. If parent `clip` is not
99-
// defined, use the current node's clip.
100-
93+
// Find the current node's clipping rect and intersect it with the inherited clipping rect, if one exists
10194
let mut clip_rect = Rect::from_center_size(
10295
global_transform.translation().truncate(),
10396
computed_node.size(),

0 commit comments

Comments
 (0)