-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 #12255 Updating TargetCamera on multi camera scenes not allowing layout to be calculated #12268
Conversation
Check to make sure the layout is getting calculated when TargetCamera is being updated on a node.
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
Make sure the children are being cleaned up and maintain taffy references to camera nodes
7f42846
to
71c028e
Compare
ce49fbb
to
538dd38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough experience in this area of code to do much other than a rubber stamp. The only things I noticed were some very tiny nits, non blocking. This adds a regression test, which is great. The only thing I'm uncertain of is if this breaks some untested invariant about taffy nodes somewhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with this fix. Thanks a ton for the regression test! I think we should make the UI camera association explicit rather than the complex somewhat magical approach currently used, but that's another PR.
…layout to be calculated (#12268) # Objective - Fixes #12255 Still needs confirming what the consequences are from having camera viewport nodes live on the root of the taffy tree. ## Solution To fix calculating the layouts for UI nodes we need to cleanup the children previously set whenever `TargetCamera` is updated. This also maintains a list of taffy camera nodes and cleans them up when removed. --- ## Changelog Fixed #12255 ## Migration Guide changes affect private structs/members so shouldn't need actions by engine users.
… allowing layout to be calculated (bevyengine#12268) # Objective - Fixes bevyengine#12255 Still needs confirming what the consequences are from having camera viewport nodes live on the root of the taffy tree. ## Solution To fix calculating the layouts for UI nodes we need to cleanup the children previously set whenever `TargetCamera` is updated. This also maintains a list of taffy camera nodes and cleans them up when removed. --- ## Changelog Fixed bevyengine#12255 ## Migration Guide changes affect private structs/members so shouldn't need actions by engine users.
… allowing layout to be calculated (bevyengine#12268) # Objective - Fixes bevyengine#12255 Still needs confirming what the consequences are from having camera viewport nodes live on the root of the taffy tree. ## Solution To fix calculating the layouts for UI nodes we need to cleanup the children previously set whenever `TargetCamera` is updated. This also maintains a list of taffy camera nodes and cleans them up when removed. --- ## Changelog Fixed bevyengine#12255 ## Migration Guide changes affect private structs/members so shouldn't need actions by engine users.
# Objective Fix the regression for Root Node's Layout behavior introduced in #12268 - Add regression test for Root Node Layout's behaving as they did before 0.13.1 - Restore pre 0.13.1 Root Node Layout behavior (fixes #12624) ## Solution This implements [@nicoburns suggestion ](https://discord.com/channels/691052431525675048/743663673393938453/1221593626476548146), where instead of adding the camera to the taffy node tree, we revert back to adding a new "parent" node for each root node while maintaining their relationship with the camera. > If you can do the ecs change detection to move the node to the correct Taffy instance for the camera then you should also be able to move it to a `Vec` of root nodes for that camera. --- ## Changelog Fixed #12624 - Restores pre 0.13.1 Root Node Layout behavior ## Migration Guide If you were affected by the 0.13.1 regression and added `position_type: Absolute` to all your root nodes you might be able to reclaim some LOC by removing them now that the 0.13 behavior is restored.
# Objective Fix the regression for Root Node's Layout behavior introduced in #12268 - Add regression test for Root Node Layout's behaving as they did before 0.13.1 - Restore pre 0.13.1 Root Node Layout behavior (fixes #12624) ## Solution This implements [@nicoburns suggestion ](https://discord.com/channels/691052431525675048/743663673393938453/1221593626476548146), where instead of adding the camera to the taffy node tree, we revert back to adding a new "parent" node for each root node while maintaining their relationship with the camera. > If you can do the ecs change detection to move the node to the correct Taffy instance for the camera then you should also be able to move it to a `Vec` of root nodes for that camera. --- ## Changelog Fixed #12624 - Restores pre 0.13.1 Root Node Layout behavior ## Migration Guide If you were affected by the 0.13.1 regression and added `position_type: Absolute` to all your root nodes you might be able to reclaim some LOC by removing them now that the 0.13 behavior is restored.
Apply rustfmt Move test_initialization next to other tests Add doc comment to is_root_node_pair_valid Move helper methods into the single test case where they are used Add tests for helper methods Remove trait helpers to reduce complexity of tests Mark specific test functions as unreachable Move ui_surface test only methods into mod tests as trait Fix tests after rebase Add tests for bevy_ui/layout/ui_surface Widen type for parameter children in UiSurface::update_children Add missing asserts and Debug fields in UiSurface from bevyengine#12268 and bevyengine#12698
Objective
Still needs confirming what the consequences are from having camera viewport nodes live on the root of the taffy tree.
Solution
To fix calculating the layouts for UI nodes we need to cleanup the children previously set whenever
TargetCamera
is updated. This also maintains a list of taffy camera nodes and cleans them up when removed.Changelog
Fixed #12255
Migration Guide
changes affect private structs/members so shouldn't need actions by engine users.