-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
fix issue with phantom ui node children #14490
Conversation
Please don't merge yet, I noticed that there was an optimization update for the children update that I should be using. I also realized that it might be better to use |
d76025a
to
f1d8190
Compare
I have replaced the loop with the iter as in the first update. Discord tells me changing the query wouldn't help 🤷 |
# Objective The `ui_layout_system` relies on change detection to sync parent-child relation to taffy. The children need to by synced before node removal to avoid trying to set deleted nodes as children (due to how the different queries collect entities). This however may leave nodes that were removed set as children to other nodes in special cases. Fixes #11385 ## Solution The solution is simply to re-sync the changed children after the nodes are removed. ## Testing Tested with `sickle_ui` where docking zone highlights would end up glitched when docking was done in a certain manner: - run the `docking_zone_splits` example - pop out a tab from the top - dock the floating panel in the center right - grab another tab and try to hover the original static docking zone: the highlight is semi-stuck - (NOTE: sometimes it worked even without the fix due to scheduling order not producing the bugged query results) After the fix, the issue is no longer present. NOTE: The performance impact should be minimal, as the child sync relies on change detection. The change detection was also the reason the parent nodes remained "stuck" with the phantom children if no other update were done to them.
Objective
The
ui_layout_system
relies on change detection to sync parent-child relation to taffy. The children need to by synced before node removal to avoid trying to set deleted nodes as children (due to how the different queries collect entities). This however may leave nodes that were removed set as children to other nodes in special cases.Fixes #11385
Solution
The solution is simply to re-sync the changed children after the nodes are removed.
Testing
Tested with
sickle_ui
where docking zone highlights would end up glitched when docking was done in a certain manner:docking_zone_splits
exampleAfter the fix, the issue is no longer present.
NOTE: The performance impact should be minimal, as the child sync relies on change detection. The change detection was also the reason the parent nodes remained "stuck" with the phantom children if no other update were done to them.