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

19 lines
491 B
Rust
Raw Normal View History

2019-10-05 19:22:51 +02:00
use crate::{Primitive, Renderer};
2019-11-24 10:44:55 +01:00
use iced_native::{image, Layout, MouseCursor};
2019-10-05 19:22:51 +02:00
impl image::Renderer for Renderer {
fn dimensions(&self, path: &str) -> (u32, u32) {
self.image_pipeline.dimensions(path)
2019-10-05 19:22:51 +02:00
}
2019-11-24 10:44:55 +01:00
fn draw(&mut self, path: &str, layout: Layout<'_>) -> Self::Output {
(
Primitive::Image {
2019-11-24 10:44:55 +01:00
path: String::from(path),
bounds: layout.bounds(),
},
MouseCursor::OutOfBounds,
)
2019-10-05 19:22:51 +02:00
}
}