summaryrefslogtreecommitdiffstats
path: root/graphics/src/widget/svg.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2021-11-07 15:15:33 +0700
committerLibravatar GitHub <noreply@github.com>2021-11-07 15:15:33 +0700
commiteafad00af2a9bae9f3ed8124e2a6f6e59ee5d253 (patch)
tree76413948c9c9723075189d51d4c2e02c0f8fdd23 /graphics/src/widget/svg.rs
parent61c747b53589d98f477fea95f85d2ea5349666d3 (diff)
parent07b5097bc92ced376d09115d787ff1d2ebe00836 (diff)
downloadiced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.tar.gz
iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.tar.bz2
iced-eafad00af2a9bae9f3ed8124e2a6f6e59ee5d253.zip
Merge pull request #1110 from iced-rs/remove-renderer-traits
Reduce the surface of the `Renderer` APIs
Diffstat (limited to 'graphics/src/widget/svg.rs')
-rw-r--r--graphics/src/widget/svg.rs21
1 files changed, 6 insertions, 15 deletions
diff --git a/graphics/src/widget/svg.rs b/graphics/src/widget/svg.rs
index 8b5ed66a..5817a552 100644
--- a/graphics/src/widget/svg.rs
+++ b/graphics/src/widget/svg.rs
@@ -1,9 +1,10 @@
//! Display vector graphics in your application.
use crate::backend::{self, Backend};
-use crate::{Primitive, Renderer};
-use iced_native::{mouse, svg, Layout};
+use crate::{Primitive, Rectangle, Renderer};
+use iced_native::svg;
-pub use iced_native::svg::{Handle, Svg};
+pub use iced_native::widget::svg::Svg;
+pub use svg::Handle;
impl<B> svg::Renderer for Renderer<B>
where
@@ -13,17 +14,7 @@ where
self.backend().viewport_dimensions(handle)
}
- fn draw(
- &mut self,
- handle: svg::Handle,
- layout: Layout<'_>,
- ) -> Self::Output {
- (
- Primitive::Svg {
- handle,
- bounds: layout.bounds(),
- },
- mouse::Interaction::default(),
- )
+ fn draw(&mut self, handle: svg::Handle, bounds: Rectangle) {
+ self.draw_primitive(Primitive::Svg { handle, bounds })
}
}