bevy/crates/bevy_sprite/src
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
..
mesh2d Fix Mesh2d normals on webgl (#10967) 2023-12-13 20:26:17 +00:00
render Add docs to bevy_sprite a little (#10947) 2023-12-14 17:25:55 +00:00
bundle.rs Add docs to bevy_sprite a little (#10947) 2023-12-14 17:25:55 +00:00
collide_aabb.rs Add docs to bevy_sprite a little (#10947) 2023-12-14 17:25:55 +00:00
dynamic_texture_atlas_builder.rs Replace all usages of texture_descritor.size.* with the helper methods (#10227) 2023-10-23 20:49:02 +00:00
lib.rs Update AABB when Sprite component changes in calculate_bounds_2d() (#11016) 2023-12-18 20:55:12 +00:00
sprite.rs Add docs to bevy_sprite a little (#10947) 2023-12-14 17:25:55 +00:00
texture_atlas_builder.rs Replace all usages of texture_descritor.size.* with the helper methods (#10227) 2023-10-23 20:49:02 +00:00
texture_atlas.rs Add docs to bevy_sprite a little (#10947) 2023-12-14 17:25:55 +00:00