diff options
author | 2019-11-18 21:55:20 +0100 | |
---|---|---|
committer | 2019-11-18 21:55:20 +0100 | |
commit | 54ffefcc0b8f4558a93ca51f044594db009bacc8 (patch) | |
tree | d915860ee02bb0041ef5aad4660466c5420ca62e /native/src/widget/image.rs | |
parent | 2cbd5d60c46d956fcab685b448a40c1aa5f5b69f (diff) | |
parent | 6cdf69e76b8052fb726d5c2bf6c9746182e04d05 (diff) | |
download | iced-54ffefcc0b8f4558a93ca51f044594db009bacc8.tar.gz iced-54ffefcc0b8f4558a93ca51f044594db009bacc8.tar.bz2 iced-54ffefcc0b8f4558a93ca51f044594db009bacc8.zip |
Merge pull request #60 from hecrj/fix/required-width-height
Make `width` and `height` in `Widget` required methods
Diffstat (limited to 'native/src/widget/image.rs')
-rw-r--r-- | native/src/widget/image.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs index b2541b87..1e203077 100644 --- a/native/src/widget/image.rs +++ b/native/src/widget/image.rs @@ -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, |