Add Image rotation support

Co-authored-by: DKolter <68352124+DKolter@users.noreply.github.com>
This commit is contained in:
Héctor Ramón Jiménez 2024-05-02 13:15:17 +02:00
parent aae8e4f5cf
commit 09a6bcfffc
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
19 changed files with 374 additions and 84 deletions

View file

@ -2,9 +2,7 @@
#[cfg(feature = "image")]
pub use ::image as image_rs;
use crate::core::image;
use crate::core::svg;
use crate::core::{Color, Rectangle};
use crate::core::{image, svg, Color, Rectangle, Size};
/// A raster or vector image.
#[derive(Debug, Clone, PartialEq)]
@ -19,6 +17,12 @@ pub enum Image {
/// The bounds of the image.
bounds: Rectangle,
/// The rotation of the image in radians
rotation: f32,
/// The scale of the image after rotation
scale: Size,
},
/// A vector image.
Vector {
@ -30,6 +34,12 @@ pub enum Image {
/// The bounds of the image.
bounds: Rectangle,
/// The rotation of the image in radians
rotation: f32,
/// The scale of the image after rotation
scale: Size,
},
}