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

UI layout tree debug print #8521

Merged
merged 7 commits into from
May 8, 2023

Conversation

ickshonpe
Copy link
Contributor

Objective

Copy the debug::print_tree function from Taffy except display entity ids instead of Taffy's node ids and indicate which ui nodes have a measure func.

@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use labels May 1, 2023
@alice-i-cecile alice-i-cecile requested a review from nicoburns May 1, 2023 15:41
@alice-i-cecile alice-i-cecile added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 3, 2023
Copy link
Member

@mockersf mockersf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to avoid println! and use one of the log macro as they are supported on all platforms

@ickshonpe
Copy link
Contributor Author

I would prefer to avoid println! and use one of the log macro as they are supported on all platforms

info! seems like the right level?

Copy link
Contributor

@nicoburns nicoburns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine. Seems like ideally Taffy's function would be made more generic. But probably easier to just do it like this for now.

@ickshonpe ickshonpe requested a review from mockersf May 8, 2023 07:59
@ickshonpe
Copy link
Contributor Author

This seems fine. Seems like ideally Taffy's function would be made more generic. But probably easier to just do it like this for now.

Yeah, this is just a starting point, as our debugging options are so poor atm. Maybe a version that uses a SystemParam to access the style and content data so that it can walk the tree and point out potential problems could be useful as well.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue May 8, 2023
Merged via the queue into bevyengine:main with commit 845f027 May 8, 2023
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-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants