2019-10-05 19:22:51 +02:00
|
|
|
use crate::{Primitive, Renderer};
|
2019-11-10 01:55:32 +01:00
|
|
|
use iced_native::{image, layout, Image, Layout, MouseCursor, Rectangle};
|
2019-10-05 19:22:51 +02:00
|
|
|
|
2019-10-22 23:20:24 +02:00
|
|
|
impl image::Renderer for Renderer {
|
2019-11-10 01:55:32 +01:00
|
|
|
fn layout(&self, image: &Image, limits: &layout::Limits) -> Layout {
|
|
|
|
|
// TODO
|
|
|
|
|
Layout::new(Rectangle {
|
|
|
|
|
x: 0.0,
|
|
|
|
|
y: 0.0,
|
|
|
|
|
width: 0.0,
|
|
|
|
|
height: 0.0,
|
|
|
|
|
})
|
2019-10-05 19:22:51 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-10 01:55:32 +01:00
|
|
|
fn draw(&mut self, image: &Image, layout: &Layout) -> Self::Output {
|
2019-10-23 01:21:23 +02:00
|
|
|
(
|
|
|
|
|
Primitive::Image {
|
|
|
|
|
path: image.path.clone(),
|
|
|
|
|
bounds: layout.bounds(),
|
|
|
|
|
},
|
|
|
|
|
MouseCursor::OutOfBounds,
|
|
|
|
|
)
|
2019-10-05 19:22:51 +02:00
|
|
|
}
|
|
|
|
|
}
|