summaryrefslogtreecommitdiff
path: root/src/layout/background.rs
diff options
context:
space:
mode:
authorMartin Haug <mhaug@live.de>2021-05-26 22:52:02 +0200
committerLaurenz <laurmaedje@gmail.com>2021-05-26 22:57:29 +0200
commite27f6c10146240a6c8b92930b27948083f08c9b5 (patch)
tree4b1d1fb574dfa164a76f758f989af04b8897cf6c /src/layout/background.rs
parent14f093bfee3d0871d9796a0dcaf1648b76010930 (diff)
Add hash impls for all nodes
This prepares the incremental PR. Co-Authored-By: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'src/layout/background.rs')
-rw-r--r--src/layout/background.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/layout/background.rs b/src/layout/background.rs
index a5afbc4a..3a76a264 100644
--- a/src/layout/background.rs
+++ b/src/layout/background.rs
@@ -1,7 +1,7 @@
use super::*;
/// A node that places a rectangular filled background behind its child.
-#[derive(Debug, Clone, PartialEq)]
+#[derive(Debug, Clone, PartialEq, Hash)]
pub struct BackgroundNode {
/// The kind of shape to use as a background.
pub shape: BackgroundShape,
@@ -12,7 +12,7 @@ pub struct BackgroundNode {
}
/// The kind of shape to use as a background.
-#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
pub enum BackgroundShape {
Rect,
Ellipse,
@@ -24,7 +24,7 @@ impl Layout for BackgroundNode {
for frame in &mut frames {
let (point, shape) = match self.shape {
- BackgroundShape::Rect => (Point::ZERO, Shape::Rect(frame.size)),
+ BackgroundShape::Rect => (Point::zero(), Shape::Rect(frame.size)),
BackgroundShape::Ellipse => {
(frame.size.to_point() / 2.0, Shape::Ellipse(frame.size))
}