bevy/crates/bevy_render
st0rmbtw 8efcbf3e4f
Add convenient methods for Image (#10221)
# Objective
To get the width or height of an image you do:
```rust
self.texture_descriptor.size.{width, height}
```
that is quite verbose.
This PR adds some convenient methods for Image to reduce verbosity.

## Changelog
* Add a `width()` method for getting the width of an image.
* Add a `height()` method for getting the height of an image.
* Rename the `size()` method to `size_f32()`.
* Add a `size()` method for getting the size of an image as u32.
* Renamed the `aspect_2d()` method to `aspect_ratio()`.

## Migration Guide
Replace calls to the `Image::size()` method with `size_f32()`.
Replace calls to the `Image::aspect_2d()` method with `aspect_ratio()`.
2023-10-22 01:45:29 +00:00
..
macros allow extensions to StandardMaterial (#7820) 2023-10-17 21:28:08 +00:00
src Add convenient methods for Image (#10221) 2023-10-22 01:45:29 +00:00
Cargo.toml update shader imports (#10180) 2023-10-21 11:51:58 +00:00