Make width and height required methods

This commit is contained in:
Héctor Ramón Jiménez 2019-11-16 22:08:49 +01:00
parent 2cbd5d60c4
commit 6cdf69e76b
13 changed files with 78 additions and 10 deletions

View file

@ -1,6 +1,6 @@
//! Display images in your user interface.
use crate::{layout, Element, Hasher, Layout, Point, Widget};
use crate::{layout, Element, Hasher, Layout, Length, Point, Widget};
use std::hash::Hash;
@ -10,6 +10,14 @@ impl<Message, Renderer> Widget<Message, Renderer> for Image
where
Renderer: self::Renderer,
{
fn width(&self) -> Length {
self.width
}
fn height(&self) -> Length {
self.height
}
fn layout(
&self,
renderer: &Renderer,