File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -525,7 +525,7 @@ pub fn extract_uinode_borders(
525
525
let border_radius = clamp_radius ( border_radius, uinode. size ( ) , border. into ( ) ) ;
526
526
527
527
// don't extract border if no border or the node is zero-sized (a zero sized node can still have an outline).
528
- if uinode. size ( ) . x > 0. && uinode . size ( ) . y > 0. && border != [ 0. ; 4 ] {
528
+ if ! uinode. is_empty ( ) && border != [ 0. ; 4 ] {
529
529
if let Some ( border_color) = maybe_border_color {
530
530
extracted_uinodes. uinodes . insert (
531
531
commands. spawn_empty ( ) . id ( ) ,
@@ -698,7 +698,7 @@ pub fn extract_uinode_text(
698
698
} ;
699
699
700
700
// Skip if not visible or if size is set to zero (e.g. when a parent is set to `Display::None`)
701
- if !view_visibility. get ( ) || uinode. size ( ) . x == 0. || uinode . size ( ) . y == 0. {
701
+ if !view_visibility. get ( ) || uinode. is_empty ( ) {
702
702
continue ;
703
703
}
704
704
Original file line number Diff line number Diff line change @@ -63,6 +63,13 @@ impl Node {
63
63
self . calculated_size
64
64
}
65
65
66
+ /// Check if the node is empty.
67
+ /// A node is considered empty if it has a zero or negative extent along either of its axes.
68
+ #[ inline]
69
+ pub fn is_empty ( & self ) -> bool {
70
+ self . size ( ) . cmple ( Vec2 :: ZERO ) . any ( )
71
+ }
72
+
66
73
/// The order of the node in the UI layout.
67
74
/// Nodes with a higher stack index are drawn on top of and receive interactions before nodes with lower stack indices.
68
75
pub const fn stack_index ( & self ) -> u32 {
You can’t perform that action at this time.
0 commit comments