Fix Image::bounds when rotation present in iced_graphics

This commit is contained in:
Héctor Ramón Jiménez 2024-05-03 07:04:57 +02:00
parent 568ac66486
commit eac5bcb64f
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 37 additions and 17 deletions

View file

@ -41,9 +41,12 @@ impl Image {
/// Returns the bounds of the [`Image`].
pub fn bounds(&self) -> Rectangle {
match self {
Image::Raster { bounds, .. } | Image::Vector { bounds, .. } => {
*bounds
Image::Raster {
bounds, rotation, ..
}
| Image::Vector {
bounds, rotation, ..
} => bounds.rotate(*rotation),
}
}
}