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

Change Urect::width & Urect::height to be const #9640

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

EmiOnGit
Copy link
Contributor

Objective

The two functions
Urect::height,
Urect::width
are currently not const.
Since the methods are very unlikely to change (ever) and are useful to be const for some games, they should be.

@EmiOnGit
Copy link
Contributor Author

Also just saw that #7557 is related

@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 Aug 30, 2023
@alice-i-cecile
Copy link
Member

If only we had constant float arithmetic :( One day, maybe.

@EmiOnGit
Copy link
Contributor Author

If only we had constant float arithmetic :( One day, maybe.

So true. I feel like so many crates would benefit greatly. :(
Sadly, it seems like the progress on const float arithmetics is stalled

@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 Aug 30, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 30, 2023
Merged via the queue into bevyengine:main with commit 36eedbf Aug 30, 2023
25 checks passed
@EmiOnGit EmiOnGit deleted the const branch August 30, 2023 18:10
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective
The two functions

[`Urect::height`](https://docs.rs/bevy_math/latest/bevy_math/struct.URect.html#method.height),

[`Urect::width`](https://docs.rs/bevy_math/latest/bevy_math/struct.URect.html#method.width)
 are currently not const. 
Since the methods are very unlikely to change (ever) and are useful to
be const for some games, they should be.

Co-authored-by: Emi <emanuel.boehm@gmail.com>
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.

3 participants