`Display::None` propagation bug
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## 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:
2. With `Display::None` set on the innermost node:
3. With `Display::None` set on the outermost node:
## 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.
Contributor guide
Research direction
Run the display_and_visibility example and compare the three cases described in the issue. Trace outline extraction for the innermost node, checking how an ancestor's Display::None affects descendants; done means descendants of a hidden ancestor produce no visible outline.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100