Introduce dynamic opacity support for Image and Svg

This commit is contained in:
Héctor Ramón Jiménez 2024-05-03 13:25:58 +02:00
parent 38cf87cb45
commit fa9e1d96ea
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
18 changed files with 142 additions and 33 deletions

View file

@ -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,
);
}
}