summaryrefslogtreecommitdiffstats
path: root/renderer
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 03:28:43 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-08-04 03:28:43 +0200
commit0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a (patch)
treec44e036220ea40734a00bb8e05e4afa6a9504bea /renderer
parent87a613edd186461f1a8d224394043527a372571c (diff)
downloadiced-0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a.tar.gz
iced-0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a.tar.bz2
iced-0ceee1cf3ae49f5bd0e3f2b346a4b34076e4523a.zip
Implement image support for `canvas` widget
Diffstat (limited to 'renderer')
-rw-r--r--renderer/src/fallback.rs42
1 files changed, 39 insertions, 3 deletions
diff --git a/renderer/src/fallback.rs b/renderer/src/fallback.rs
index 6a169692..ddf7fd95 100644
--- a/renderer/src/fallback.rs
+++ b/renderer/src/fallback.rs
@@ -572,6 +572,42 @@ mod geometry {
delegate!(self, frame, frame.fill_text(text));
}
+ fn draw_image(
+ &mut self,
+ handle: &iced_wgpu::core::image::Handle,
+ bounds: Rectangle,
+ filter_method: iced_wgpu::core::image::FilterMethod,
+ rotation: Radians,
+ opacity: f32,
+ ) {
+ delegate!(
+ self,
+ frame,
+ frame.draw_image(
+ handle,
+ bounds,
+ filter_method,
+ rotation,
+ opacity
+ )
+ );
+ }
+
+ fn draw_svg(
+ &mut self,
+ handle: &iced_wgpu::core::svg::Handle,
+ bounds: Rectangle,
+ color: Option<iced_wgpu::core::Color>,
+ rotation: Radians,
+ opacity: f32,
+ ) {
+ delegate!(
+ self,
+ frame,
+ frame.draw_svg(handle, bounds, color, rotation, opacity)
+ );
+ }
+
fn push_transform(&mut self) {
delegate!(self, frame, frame.push_transform());
}
@@ -587,13 +623,13 @@ mod geometry {
}
}
- fn paste(&mut self, frame: Self, at: Point) {
+ fn paste(&mut self, frame: Self) {
match (self, frame) {
(Self::Primary(target), Self::Primary(source)) => {
- target.paste(source, at);
+ target.paste(source);
}
(Self::Secondary(target), Self::Secondary(source)) => {
- target.paste(source, at);
+ target.paste(source);
}
_ => unreachable!(),
}