summaryrefslogtreecommitdiffstats
path: root/wgpu/src/layer.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:52:55 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 04:52:55 +0200
commitd4b08462e5a25929ec4df32f242898986902af56 (patch)
tree4c6aaf8519b416ebf075fd780e533543416cc81e /wgpu/src/layer.rs
parent8708101c892540ffc966cf7ee9d66ca5cd2e8ca6 (diff)
downloadiced-d4b08462e5a25929ec4df32f242898986902af56.tar.gz
iced-d4b08462e5a25929ec4df32f242898986902af56.tar.bz2
iced-d4b08462e5a25929ec4df32f242898986902af56.zip
Introduce `Svg` struct in `core::svg`
Diffstat (limited to '')
-rw-r--r--wgpu/src/layer.rs33
1 files changed, 5 insertions, 28 deletions
diff --git a/wgpu/src/layer.rs b/wgpu/src/layer.rs
index 71fa0250..68d5a015 100644
--- a/wgpu/src/layer.rs
+++ b/wgpu/src/layer.rs
@@ -1,6 +1,5 @@
use crate::core::{
- self, renderer, Background, Color, Point, Radians, Rectangle,
- Transformation,
+ self, renderer, Background, Color, Point, Rectangle, Svg, Transformation,
};
use crate::graphics;
use crate::graphics::color;
@@ -118,21 +117,8 @@ impl Layer {
Image::Raster(image, bounds) => {
self.draw_raster(image, bounds, transformation);
}
- Image::Vector {
- handle,
- color,
- bounds,
- rotation,
- opacity,
- } => {
- self.draw_svg(
- handle.clone(),
- color,
- bounds,
- transformation,
- rotation,
- opacity,
- );
+ Image::Vector(svg, bounds) => {
+ self.draw_svg(svg, bounds, transformation);
}
}
}
@@ -150,20 +136,11 @@ impl Layer {
pub fn draw_svg(
&mut self,
- handle: crate::core::svg::Handle,
- color: Option<Color>,
+ svg: Svg,
bounds: Rectangle,
transformation: Transformation,
- rotation: Radians,
- opacity: f32,
) {
- let svg = Image::Vector {
- handle,
- color,
- bounds: bounds * transformation,
- rotation,
- opacity,
- };
+ let svg = Image::Vector(svg, bounds * transformation);
self.images.push(svg);
}