Skip to content

Commit

Permalink
Ignore UI nodes with a ZERO rect (#321)
Browse files Browse the repository at this point in the history
Continuing computation with these nodes leads to a false positive hit
after a division with zero.

Fixes #320
  • Loading branch information
keis authored Jun 12, 2024
1 parent e244d0b commit bbb4580
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 bbb4580

Please sign in to comment.