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

Add methods for calculating the size and postion of UI nodes #7930

Merged
merged 14 commits into from
Mar 9, 2023

Conversation

ickshonpe
Copy link
Contributor

Objective

Users are often confused about how to calculate the size and position of UI nodes.

Solution

Implement methods on Node to calculate its size and position given its GlobalTransform.

Changelog

  • Added methods logical_rect and physical_rect that calculate the geometry of a UI node and return it as a bevy_math::Rect

@ickshonpe ickshonpe changed the title methods to calculate the size and postion of UI nodes Add methods for calculating the size and postion of UI nodes Mar 6, 2023
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A simple quality-of-life change that makes Bevy easier to use labels Mar 6, 2023
@alice-i-cecile
Copy link
Member

This will be super useful for tests too.

@ickshonpe
Copy link
Contributor Author

ickshonpe commented Mar 6, 2023

For some reason it pulled in my changes from the UI example fix PR. Fixed, I think.

@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 Mar 8, 2023
crates/bevy_ui/src/ui_node.rs Show resolved Hide resolved
ickshonpe and others added 2 commits March 9, 2023 10:15
Co-authored-by: François <mockersf@gmail.com>
Co-authored-by: François <mockersf@gmail.com>
@mockersf mockersf added this pull request to the merge queue Mar 9, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 9, 2023
@mockersf mockersf added this pull request to the merge queue Mar 9, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 9, 2023
@mockersf mockersf added this pull request to the merge queue Mar 9, 2023
Merged via the queue into bevyengine:main with commit f554700 Mar 9, 2023
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 2023
Shfty pushed a commit to shfty-rust/bevy that referenced this pull request Mar 19, 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 simple 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.

None yet

5 participants