summaryrefslogblamecommitdiffstats
path: root/wgpu/src/renderer/widget/svg.rs
blob: f6d6d0baaf84a2607d4c70e857813eb5f01249c9 (plain) (tree)
1
2
                                 
                                      















                                                              
                                          


         
use crate::{Primitive, Renderer};
use iced_native::{mouse, svg, Layout};

impl svg::Renderer for Renderer {
    fn dimensions(&self, handle: &svg::Handle) -> (u32, u32) {
        self.image_pipeline.viewport_dimensions(handle)
    }

    fn draw(
        &mut self,
        handle: svg::Handle,
        layout: Layout<'_>,
    ) -> Self::Output {
        (
            Primitive::Svg {
                handle,
                bounds: layout.bounds(),
            },
            mouse::Interaction::default(),
        )
    }
}