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

@ -1,5 +1,6 @@
use crate::core::renderer;
use crate::core::{Background, Color, Point, Rectangle, Transformation};
use crate::core::{
renderer, Background, Color, Point, Rectangle, Size, Transformation,
};
use crate::graphics;
use crate::graphics::color;
use crate::graphics::layer;
@ -117,11 +118,15 @@ impl Layer {
filter_method: crate::core::image::FilterMethod,
bounds: Rectangle,
transformation: Transformation,
rotation: f32,
scale: Size,
) {
let image = Image::Raster {
handle,
filter_method,
bounds: bounds * transformation,
rotation,
scale,
};
self.images.push(image);
@ -133,11 +138,15 @@ impl Layer {
color: Option<Color>,
bounds: Rectangle,
transformation: Transformation,
rotation: f32,
scale: Size,
) {
let svg = Image::Vector {
handle,
color,
bounds: bounds * transformation,
rotation,
scale,
};
self.images.push(svg);