Merge unnecessary split widget modules
This commit is contained in:
parent
c2e0c52ce0
commit
e618091248
28 changed files with 1032 additions and 1037 deletions
28
graphics/src/widget/svg.rs
Normal file
28
graphics/src/widget/svg.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
use crate::backend::{self, Backend};
|
||||
use crate::{Primitive, Renderer};
|
||||
use iced_native::{mouse, svg, Layout};
|
||||
|
||||
pub use iced_native::Svg;
|
||||
|
||||
impl<B> svg::Renderer for Renderer<B>
|
||||
where
|
||||
B: Backend + backend::Svg,
|
||||
{
|
||||
fn dimensions(&self, handle: &svg::Handle) -> (u32, u32) {
|
||||
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(),
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue