summaryrefslogtreecommitdiffstats
path: root/wgpu/src/lib.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-03 13:25:58 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-05-03 13:25:58 +0200
commitfa9e1d96ea1924b51749b775ea0e67e69bc8a305 (patch)
tree20cb13d6e3074569a15a16c8b0d261b1875a2045 /wgpu/src/lib.rs
parent38cf87cb45484c7e52ddf775fb3abd7edbecc652 (diff)
downloadiced-fa9e1d96ea1924b51749b775ea0e67e69bc8a305.tar.gz
iced-fa9e1d96ea1924b51749b775ea0e67e69bc8a305.tar.bz2
iced-fa9e1d96ea1924b51749b775ea0e67e69bc8a305.zip
Introduce dynamic `opacity` support for `Image` and `Svg`
Diffstat (limited to 'wgpu/src/lib.rs')
-rw-r--r--wgpu/src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/wgpu/src/lib.rs b/wgpu/src/lib.rs
index eb600dde..4c168029 100644
--- a/wgpu/src/lib.rs
+++ b/wgpu/src/lib.rs
@@ -518,6 +518,7 @@ impl core::image::Renderer for Renderer {
filter_method: core::image::FilterMethod,
bounds: Rectangle,
rotation: core::Radians,
+ opacity: f32,
) {
let (layer, transformation) = self.layers.current_mut();
layer.draw_image(
@@ -526,6 +527,7 @@ impl core::image::Renderer for Renderer {
bounds,
transformation,
rotation,
+ opacity,
);
}
}
@@ -542,9 +544,17 @@ impl core::svg::Renderer for Renderer {
color_filter: Option<Color>,
bounds: Rectangle,
rotation: core::Radians,
+ opacity: f32,
) {
let (layer, transformation) = self.layers.current_mut();
- layer.draw_svg(handle, color_filter, bounds, transformation, rotation);
+ layer.draw_svg(
+ handle,
+ color_filter,
+ bounds,
+ transformation,
+ rotation,
+ opacity,
+ );
}
}