Skip to content

Commit

Permalink
Ignore UI nodes with a ZERO rect
Browse files Browse the repository at this point in the history
  • Loading branch information
keis committed Mar 25, 2024
1 parent 44cdb27 commit 0da95b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions backends/bevy_picking_ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ pub fn ui_picking(

let node_rect = node.node.logical_rect(node.global_transform);

// Nodes with Display::None have a (0., 0.) logical rect and can be ignored
if node_rect.size() == Vec2::ZERO {
continue;
}

// Intersect with the calculated clip rect to find the bounds of the visible region of the node
let visible_rect = node
.calculated_clip
Expand Down

0 comments on commit 0da95b2

Please sign in to comment.