1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use super::super::{
    super::{widget::image, Rotation},
    IcedRenderer, Primitive,
};
use iced::mouse;
use vek::Rgba;

impl image::Renderer for IcedRenderer {
    fn dimensions(&self, handle: image::Handle) -> (u32, u32) { self.image_dims(handle) }

    fn draw(
        &mut self,
        handle: image::Handle,
        color: Rgba<u8>,
        layout: iced::Layout<'_>,
    ) -> Self::Output {
        (
            Primitive::Image {
                handle: (handle, Rotation::None),
                bounds: layout.bounds(),
                color,
                source_rect: None,
            },
            mouse::Interaction::default(),
        )
    }
}