iced-yoda/wgpu/src/renderer/widget/image.rs

23 lines
528 B
Rust
Raw Normal View History

2019-10-05 19:22:51 +02:00
use crate::{Primitive, Renderer};
use iced_native::{image, mouse, Layout};
2019-10-05 19:22:51 +02:00
impl image::Renderer for Renderer {
fn dimensions(&self, handle: &image::Handle) -> (u32, u32) {
self.image_pipeline.dimensions(handle)
2019-10-05 19:22:51 +02:00
}
fn draw(
&mut self,
handle: image::Handle,
layout: Layout<'_>,
) -> Self::Output {
(
Primitive::Image {
handle,
bounds: layout.bounds(),
},
mouse::Interaction::default(),
)
2019-10-05 19:22:51 +02:00
}
}