summaryrefslogtreecommitdiffstats
path: root/graphics/src/layer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-12-06 05:15:16 +0100
committerLibravatar GitHub <noreply@github.com>2022-12-06 05:15:16 +0100
commitf38e7fcac2e3505d11577ade1757a77ca2a544ea (patch)
tree84b3dc6c88aa555cf931482adcf4e7be35614b72 /graphics/src/layer
parent28f0beee52f258af6bbaf8a0d9867863d7513c9b (diff)
parentf99d24e0850b63194b7976ec66d547ea2ff6bfc8 (diff)
downloadiced-f38e7fcac2e3505d11577ade1757a77ca2a544ea.tar.gz
iced-f38e7fcac2e3505d11577ade1757a77ca2a544ea.tar.bz2
iced-f38e7fcac2e3505d11577ade1757a77ca2a544ea.zip
Merge pull request #1578 from iced-rs/svg-styling
Svg styling
Diffstat (limited to '')
-rw-r--r--graphics/src/layer.rs7
-rw-r--r--graphics/src/layer/image.rs6
2 files changed, 11 insertions, 2 deletions
diff --git a/graphics/src/layer.rs b/graphics/src/layer.rs
index fd670f48..1d453caa 100644
--- a/graphics/src/layer.rs
+++ b/graphics/src/layer.rs
@@ -251,11 +251,16 @@ impl<'a> Layer<'a> {
bounds: *bounds + translation,
});
}
- Primitive::Svg { handle, bounds } => {
+ Primitive::Svg {
+ handle,
+ color,
+ bounds,
+ } => {
let layer = &mut layers[current_layer];
layer.images.push(Image::Vector {
handle: handle.clone(),
+ color: *color,
bounds: *bounds + translation,
});
}
diff --git a/graphics/src/layer/image.rs b/graphics/src/layer/image.rs
index 045ec665..3eff2397 100644
--- a/graphics/src/layer/image.rs
+++ b/graphics/src/layer/image.rs
@@ -1,4 +1,5 @@
-use crate::Rectangle;
+use crate::{Color, Rectangle};
+
use iced_native::{image, svg};
/// A raster or vector image.
@@ -17,6 +18,9 @@ pub enum Image {
/// The handle of a vector image.
handle: svg::Handle,
+ /// The [`Color`] filter
+ color: Option<Color>,
+
/// The bounds of the image.
bounds: Rectangle,
},