mirror of
https://github.com/bevyengine/bevy
synced 2024-11-23 05:03:47 +00:00
8efcbf3e4f
# 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()`. |
||
---|---|---|
.. | ||
macros | ||
src | ||
Cargo.toml |