bevy/crates/bevy_ui/src
Viktor Gustavsson 5989a845f0
Filter UI traversal to only Node and GhostNode (#15746)
# Objective

With the warning removed in
https://github.com/bevyengine/bevy/pull/15736, the rules for the UI tree
changes.
We no longer need to traverse non `Node`/`GhostNode` entities.

## Solution

- Added a filter `Or<(With<Node>, With<GhostNode>)>` to the child
traversal query so we don't unnecessarily traverse nodes that are not
part of the UI tree (like text nodes).
- Also moved the warning for NoUI->UI entities so it is actually
triggered (see comments)

## Testing

- Ran unit tests (still passing)
- Ran the ghost_nodes and ui examples, still works and looks fine 👍 
- Tested the warning by spawning a Node under an empty entity.

---

---------

Co-authored-by: UkoeHB <37489173+UkoeHB@users.noreply.github.com>
2024-10-13 17:25:15 +00:00
..
layout Filter UI traversal to only Node and GhostNode (#15746) 2024-10-13 17:25:15 +00:00
render split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
widget split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
accessibility.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
focus.rs use precomputed border values (#15163) 2024-09-26 23:10:35 +00:00
geometry.rs Remove thiserror from bevy_ui (#15760) 2024-10-09 14:27:53 +00:00
ghost_hierarchy.rs Filter UI traversal to only Node and GhostNode (#15746) 2024-10-13 17:25:15 +00:00
lib.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
measurement.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
node_bundles.rs Text rework (#15591) 2024-10-09 18:35:36 +00:00
picking_backend.rs Rename the Pickable component and fix incorrect documentation (#15707) 2024-10-07 17:09:57 +00:00
stack.rs Add UI GhostNode (#15341) 2024-10-02 00:24:28 +00:00
ui_material.rs Remove thiserror from bevy_ui (#15760) 2024-10-09 14:27:53 +00:00
ui_node.rs split up TextStyle (#15857) 2024-10-13 17:06:22 +00:00
update.rs Add UI GhostNode (#15341) 2024-10-02 00:24:28 +00:00