Apply latest changes to Image and ProgressBar

This commit is contained in:
Héctor Ramón Jiménez 2019-09-03 13:56:43 +02:00
parent b08c999ac8
commit 5c5612d931
3 changed files with 10 additions and 10 deletions

View file

@ -1,22 +1,22 @@
use crate::Point; use crate::Point;
/// A rectangle. /// A rectangle.
#[derive(Debug, PartialEq, Copy, Clone)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Rectangle { pub struct Rectangle<T = f32> {
/// X coordinate of the top-left corner. /// X coordinate of the top-left corner.
pub x: f32, pub x: T,
/// Y coordinate of the top-left corner. /// Y coordinate of the top-left corner.
pub y: f32, pub y: T,
/// Width of the rectangle. /// Width of the rectangle.
pub width: f32, pub width: T,
/// Height of the rectangle. /// 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`]. /// Returns true if the given [`Point`] is contained in the [`Rectangle`].
/// ///
/// [`Point`]: struct.Point.html /// [`Point`]: struct.Point.html

View file

@ -94,7 +94,7 @@ where
MouseCursor::OutOfBounds MouseCursor::OutOfBounds
} }
fn hash(&self, state: &mut Hasher) { fn hash_layout(&self, state: &mut Hasher) {
self.style.hash(state); self.style.hash(state);
} }
} }

View file

@ -76,7 +76,7 @@ where
MouseCursor::OutOfBounds MouseCursor::OutOfBounds
} }
fn hash(&self, state: &mut Hasher) { fn hash_layout(&self, state: &mut Hasher) {
self.style.hash(state); self.style.hash(state);
} }
} }
@ -96,7 +96,7 @@ pub trait Renderer {
/// * the progress of the [`ProgressBar`] /// * the progress of the [`ProgressBar`]
/// ///
/// [`ProgressBar`]: struct.ProgressBar.html /// [`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> impl<'a, Message, Renderer> From<ProgressBar> for Element<'a, Message, Renderer>