2019-10-05 19:22:51 +02:00
|
|
|
use crate::{Primitive, Renderer};
|
2020-04-30 08:16:38 +02:00
|
|
|
use iced_native::{image, mouse, Layout};
|
2019-10-05 19:22:51 +02:00
|
|
|
|
2019-10-22 23:20:24 +02:00
|
|
|
impl image::Renderer for Renderer {
|
2019-11-29 21:44:39 +01:00
|
|
|
fn dimensions(&self, handle: &image::Handle) -> (u32, u32) {
|
|
|
|
|
self.image_pipeline.dimensions(handle)
|
2019-10-05 19:22:51 +02:00
|
|
|
}
|
|
|
|
|
|
2019-11-29 21:44:39 +01:00
|
|
|
fn draw(
|
|
|
|
|
&mut self,
|
|
|
|
|
handle: image::Handle,
|
|
|
|
|
layout: Layout<'_>,
|
|
|
|
|
) -> Self::Output {
|
2019-10-23 01:21:23 +02:00
|
|
|
(
|
|
|
|
|
Primitive::Image {
|
2019-11-29 21:44:39 +01:00
|
|
|
handle,
|
2019-10-23 01:21:23 +02:00
|
|
|
bounds: layout.bounds(),
|
|
|
|
|
},
|
2020-04-30 08:16:38 +02:00
|
|
|
mouse::Interaction::default(),
|
2019-10-23 01:21:23 +02:00
|
|
|
)
|
2019-10-05 19:22:51 +02:00
|
|
|
}
|
|
|
|
|
}
|