summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-28 22:13:26 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2021-10-28 22:13:26 +0700
commite6156fb0c53d78ae75a1d85d4bfd81f6b7e8817e (patch)
tree85865abac6691380941a6e2297dc68dddc0699fc /graphics
parent55b31e6dcf3b8ef083e84372ba02f5a1018470db (diff)
downloadiced-e6156fb0c53d78ae75a1d85d4bfd81f6b7e8817e.tar.gz
iced-e6156fb0c53d78ae75a1d85d4bfd81f6b7e8817e.tar.bz2
iced-e6156fb0c53d78ae75a1d85d4bfd81f6b7e8817e.zip
Implement `Widget::draw` for `Svg`
Diffstat (limited to 'graphics')
-rw-r--r--graphics/src/widget/svg.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/graphics/src/widget/svg.rs b/graphics/src/widget/svg.rs
index b74a0abb..621f1a85 100644
--- a/graphics/src/widget/svg.rs
+++ b/graphics/src/widget/svg.rs
@@ -1,6 +1,6 @@
//! Display vector graphics in your application.
use crate::backend::{self, Backend};
-use crate::Renderer;
+use crate::{Primitive, Rectangle, Renderer};
use iced_native::svg;
pub use iced_native::svg::{Handle, Svg};
@@ -12,4 +12,8 @@ where
fn dimensions(&self, handle: &svg::Handle) -> (u32, u32) {
self.backend().viewport_dimensions(handle)
}
+
+ fn draw(&mut self, handle: svg::Handle, bounds: Rectangle) {
+ self.draw_primitive(Primitive::Svg { handle, bounds })
+ }
}