Skip to content

Commit 51bb4f0

Browse files
authored
expose OverflowAxis::Hidden as Overflow functions (#17528)
# Objective expose `OverflowAxis::Hidden` as functions of `Overflow`, just as it is done for `OverflowAxis::Hidden` and `OverflowAxis::Scroll`.
1 parent 203d0b4 commit 51bb4f0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

crates/bevy_ui/src/ui_node.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,30 @@ impl Overflow {
10641064
}
10651065
}
10661066

1067+
/// Hide overflowing items on both axes by influencing layout and then clipping
1068+
pub const fn hidden() -> Self {
1069+
Self {
1070+
x: OverflowAxis::Hidden,
1071+
y: OverflowAxis::Hidden,
1072+
}
1073+
}
1074+
1075+
/// Hide overflowing items on the x axis by influencing layout and then clipping
1076+
pub const fn hidden_x() -> Self {
1077+
Self {
1078+
x: OverflowAxis::Hidden,
1079+
y: OverflowAxis::Visible,
1080+
}
1081+
}
1082+
1083+
/// Hide overflowing items on the y axis by influencing layout and then clipping
1084+
pub const fn hidden_y() -> Self {
1085+
Self {
1086+
x: OverflowAxis::Visible,
1087+
y: OverflowAxis::Hidden,
1088+
}
1089+
}
1090+
10671091
/// Overflow is visible on both axes
10681092
pub const fn is_visible(&self) -> bool {
10691093
self.x.is_visible() && self.y.is_visible()

0 commit comments

Comments
 (0)