bevy/crates/bevy_sprite
Matthew Gries d99053cc8a
Update AABB when Sprite component changes in calculate_bounds_2d() (#11016)
# Objective

- Fixes #10587, where the `Aabb` component of entities with `Sprite` and
`Handle<Image>` components was not automatically updated when
`Sprite::custom_size` changed.

## 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.
2023-12-18 20:55:12 +00:00
..
src Update AABB when Sprite component changes in calculate_bounds_2d() (#11016) 2023-12-18 20:55:12 +00:00
Cargo.toml Standardize toml format with taplo (#10594) 2023-11-21 01:04:14 +00:00