summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-02 13:15:17 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-02 17:27:45 +0200
commit09a6bcfffc24f5abdc8709403bab7ae1e01563f1 (patch)
tree8a09792cd01cb56a3a5d11184a60009f8a22a85f /wgpu/src/layer.rs
parentaae8e4f5cfabfc3725ac938023fa29a6737a380c (diff)
downloadiced-09a6bcfffc24f5abdc8709403bab7ae1e01563f1.tar.gz
iced-09a6bcfffc24f5abdc8709403bab7ae1e01563f1.tar.bz2
iced-09a6bcfffc24f5abdc8709403bab7ae1e01563f1.zip
Add `Image` rotation support
Co-authored-by: DKolter <68352124+DKolter@users.noreply.github.com>
Diffstat (limited to 'wgpu/src/layer.rs')
-rw-r--r--wgpu/src/layer.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 9526c5a8..648ec476 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -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);