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

Display::None propagation bug #16904

Open
ickshonpe opened this issue Dec 19, 2024 · 0 comments · May be fixed by #16906
Open

Display::None propagation bug #16904

ickshonpe opened this issue Dec 19, 2024 · 0 comments · May be fixed by #16906
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@ickshonpe
Copy link
Contributor

ickshonpe commented Dec 19, 2024

Bevy version

Main

What you did

Added red outlines to the innermost node of Bevy's display_and_visibility example.

cargo run --example display_and_visibility

  1. Without Display::None set:
    Image

  2. With Display::None set on the innermost node:
    Image

  3. With Display::None set on the outermost node:
    Image

What went wrong

During layout recomputation if a node is found with Display::None set, that node and all its descendants are given a zero size.
This means most systems ignore those nodes since you can't mouse-over or draw inside a zero-sized element.

However zero-sized nodes can have outlines and outlines extraction only checks the local Display::None value for the outlined node and not the Display value of its ancestors. Which is why in 3 there is a visible outline around a UI node that should be removed from the layout and shouldn't even have a position to draw an outline around.

@ickshonpe ickshonpe added A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior labels Dec 19, 2024
@ickshonpe ickshonpe linked a pull request Dec 19, 2024 that will close this issue
@BenjaminBrienen BenjaminBrienen added the S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants