Fix iced_native widget examples

This commit is contained in:
Héctor Ramón Jiménez 2019-11-24 10:44:55 +01:00
parent 7a8a79cd37
commit f943764a29
6 changed files with 17 additions and 18 deletions

View file

@ -1,15 +1,15 @@
use crate::{Primitive, Renderer};
use iced_native::{image, Image, Layout, MouseCursor};
use iced_native::{image, Layout, MouseCursor};
impl image::Renderer for Renderer {
fn dimensions(&self, path: &str) -> (u32, u32) {
self.image_pipeline.dimensions(path)
}
fn draw(&mut self, image: &Image, layout: Layout<'_>) -> Self::Output {
fn draw(&mut self, path: &str, layout: Layout<'_>) -> Self::Output {
(
Primitive::Image {
path: image.path.clone(),
path: String::from(path),
bounds: layout.bounds(),
},
MouseCursor::OutOfBounds,