Skip to content

UI layout taffy sync fix #20270

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

ickshonpe
Copy link
Contributor

@ickshonpe ickshonpe commented Jul 24, 2025

Objective

#20266 only fixed half the problem as it still left the UI node's parent's children out of sync.

Solution

The Taffy children of a UI node entity need to be updated not just on Node being added but also on Node being added to any of its children.

Testing

Added a test node_addition_should_sync_parent_and_children that fails on main but passes with this PR.

…ugs.

Instead of iterating through all the UI nodes three times, just walk the tree once.
The previous fix bevyengine#20266 for the sync issues when `Node` component is added to an existing entity in a UI hierarchy only updated the taffy children of the added-node entity but its parent also needed to be updated.
@alice-i-cecile alice-i-cecile added this to the 0.17 milestone Jul 24, 2025
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 24, 2025
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-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants