Skip to content
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

Support Display::Contents #533

Open
Tracked by #345
nicoburns opened this issue Sep 11, 2023 · 0 comments · May be fixed by #534
Open
Tracked by #345

Support Display::Contents #533

nicoburns opened this issue Sep 11, 2023 · 0 comments · May be fixed by #534
Labels
enhancement New feature or request

Comments

@nicoburns
Copy link
Collaborator

nicoburns commented Sep 11, 2023

What problem does this solve or what need does it fill?

Display::Contents is useful when you want to toggle between layouts which require different tree structures without actually altering the tree structure.

Requested in bevyengine/bevy#9731

What solution would you like?

  • Add a Display::Contents variant to the Display enum
  • Alter the children iterator of the Taffy tree implementation to check each Node's Display property, an recurse into children that are set to Display::Contents, returning those grandchildren (and great-grandchildren, etc in the case that any of the grandchild nodes are themselves set to Display::Contents instead of the child itself.
  • Process the Display::Contents child itself by setting it to a zero layout.
  • I believe that this can be implemented entirely in the tree/storage layer (and the "dispatch" function that switches between algorithms) and the layout algorithm's themselves should not need any changes.

What alternative(s) have you considered?

Don't support Display::Contents and require users of Taffy to alter their tree structure if they want to achieve a similar effect.

Additional context

As the implementation is in the tree/storage layer, users of Taffy implementing custom tree/storage layers will have to implement this themselves. Implementing Display::Contents also requires the tree/storage layer to be able to access non-direct child nodes, so custom tree/storage that can only access direct children may not be to implement this.

@nicoburns nicoburns added the enhancement New feature or request label Sep 11, 2023
@nicoburns nicoburns linked a pull request Sep 11, 2023 that will close this issue
2 tasks
@nicoburns nicoburns changed the title Support Display::Contents Implement Display::Contents (tree-side implementation) Oct 25, 2023
@nicoburns nicoburns changed the title Implement Display::Contents (tree-side implementation) Implement Display::Contents Nov 9, 2023
@nicoburns nicoburns mentioned this issue May 5, 2024
37 tasks
@nicoburns nicoburns changed the title Implement Display::Contents Support Display::Contents May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant