While porting over to bevy 0.13 I noticed an issue with the tooltips I have in my UI that I toggle between Display::Flex / Display::None where a hidden one would show up as hit even when the pointer was nowhere near.
I tracked this down to L161 of backends/bevy_picking_ui/src/lib.rs which does the following
let relative_cursor_position = (*cursor_position - node_rect.min) / node_rect.size();
if visible_rect
.normalize(node_rect)
.contains(relative_cursor_position)
{
Which ends up with both the normalized rect and relative_cursor_position as -inf through division by zero
Filtering zero sized nodes out resolves the issue but there's probably a better way
While porting over to bevy 0.13 I noticed an issue with the tooltips I have in my UI that I toggle between
Display::Flex
/Display::None
where a hidden one would show up as hit even when the pointer was nowhere near.I tracked this down to L161 of
backends/bevy_picking_ui/src/lib.rs
which does the followingWhich ends up with both the normalized rect and relative_cursor_position as
-inf
through division by zeroFiltering zero sized nodes out resolves the issue but there's probably a better way