Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bevy UI node with Display::None is always hit #320

Closed
keis opened this issue Mar 17, 2024 · 0 comments · Fixed by #321
Closed

Bevy UI node with Display::None is always hit #320

keis opened this issue Mar 17, 2024 · 0 comments · Fixed by #321

Comments

@keis
Copy link
Contributor

keis commented Mar 17, 2024

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

keis added a commit to keis/bevy_mod_picking that referenced this issue Mar 25, 2024
keis added a commit to keis/bevy_mod_picking that referenced this issue Mar 25, 2024
Continuing computation with these nodes leads to a false positive hit
after a division.

Fixes aevyrie#320
keis added a commit to keis/bevy_mod_picking that referenced this issue Mar 25, 2024
Continuing computation with these nodes leads to a false positive hit
after a division with zero.

Fixes aevyrie#320
aevyrie pushed a commit that referenced this issue Jun 12, 2024
Continuing computation with these nodes leads to a false positive hit
after a division with zero.

Fixes #320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant