diff options
author | 2019-09-03 13:56:43 +0200 | |
---|---|---|
committer | 2019-09-03 13:56:43 +0200 | |
commit | 5c5612d9319cf9347e26891b15507efee30ad1b3 (patch) | |
tree | 1ba8a50a4a1a9b52c12d72da58bccb3a52f705be /src | |
parent | b08c999ac8346bfbe9d95d64c05c511a13baf895 (diff) | |
download | iced-5c5612d9319cf9347e26891b15507efee30ad1b3.tar.gz iced-5c5612d9319cf9347e26891b15507efee30ad1b3.tar.bz2 iced-5c5612d9319cf9347e26891b15507efee30ad1b3.zip |
Apply latest changes to `Image` and `ProgressBar`
Diffstat (limited to 'src')
-rw-r--r-- | src/rectangle.rs | 14 | ||||
-rw-r--r-- | src/widget/image.rs | 2 | ||||
-rw-r--r-- | src/widget/progress_bar.rs | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/rectangle.rs b/src/rectangle.rs index 9f2a1350..95c2570c 100644 --- a/src/rectangle.rs +++ b/src/rectangle.rs @@ -1,22 +1,22 @@ use crate::Point; /// A rectangle. -#[derive(Debug, PartialEq, Copy, Clone)] -pub struct Rectangle { +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct Rectangle<T = f32> { /// X coordinate of the top-left corner. - pub x: f32, + pub x: T, /// Y coordinate of the top-left corner. - pub y: f32, + pub y: T, /// Width of the rectangle. - pub width: f32, + pub width: T, /// Height of the rectangle. - pub height: f32, + pub height: T, } -impl Rectangle { +impl Rectangle<f32> { /// Returns true if the given [`Point`] is contained in the [`Rectangle`]. /// /// [`Point`]: struct.Point.html diff --git a/src/widget/image.rs b/src/widget/image.rs index 500abe0d..e85b43b5 100644 --- a/src/widget/image.rs +++ b/src/widget/image.rs @@ -94,7 +94,7 @@ where MouseCursor::OutOfBounds } - fn hash(&self, state: &mut Hasher) { + fn hash_layout(&self, state: &mut Hasher) { self.style.hash(state); } } diff --git a/src/widget/progress_bar.rs b/src/widget/progress_bar.rs index 19e164f6..0964b2db 100644 --- a/src/widget/progress_bar.rs +++ b/src/widget/progress_bar.rs @@ -76,7 +76,7 @@ where MouseCursor::OutOfBounds } - fn hash(&self, state: &mut Hasher) { + fn hash_layout(&self, state: &mut Hasher) { self.style.hash(state); } } @@ -96,7 +96,7 @@ pub trait Renderer { /// * the progress of the [`ProgressBar`] /// /// [`ProgressBar`]: struct.ProgressBar.html - fn draw(&mut self, bounds: Rectangle<f32>, progress: f32); + fn draw(&mut self, bounds: Rectangle, progress: f32); } impl<'a, Message, Renderer> From<ProgressBar> for Element<'a, Message, Renderer> |