Implement Widget::draw for Svg

This commit is contained in:
Héctor Ramón Jiménez 2021-10-28 22:13:26 +07:00
parent 55b31e6dcf
commit e6156fb0c5
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 10 additions and 4 deletions

View file

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