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

Update AABB when Sprite component changes in calculate_bounds_2d() #11016

Merged
merged 4 commits into from
Dec 18, 2023

Conversation

matthew-gries
Copy link
Contributor

Objective

Solution

  • In the query for entities with Sprite components in calculate_bounds_2d, use the Changed filter to detect for Sprites that changed as well as sprites that do not have Aabb components. As noted in the issue, this will cause the Aabb to be recalculated when other fields of the Sprite component change, but calculating the Aabb for sprites is trivial.

Changelog

  • Modified query for entities with Sprite components in calculate_bounds_2d, so that entities with Sprite components that changed will also have their AABB recalculated.

Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Dec 18, 2023
@alice-i-cecile alice-i-cecile added this to the 0.13 milestone Dec 18, 2023
@matthew-gries matthew-gries marked this pull request as ready for review December 18, 2023 16:44
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Good change, and with a nice little pair of tests!

@matiqo15 matiqo15 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 Dec 18, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Dec 18, 2023
Merged via the queue into bevyengine:main with commit d99053c Dec 18, 2023
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior 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.

Update Aabb on Sprite::custom_size changed.
3 participants