summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
Diffstat (limited to 'native')
-rw-r--r--native/src/size.rs12
-rw-r--r--native/src/widget/image.rs1
2 files changed, 13 insertions, 0 deletions
diff --git a/native/src/size.rs b/native/src/size.rs
index 30e2a57e..389b3247 100644
--- a/native/src/size.rs
+++ b/native/src/size.rs
@@ -37,3 +37,15 @@ impl Size {
}
}
}
+
+impl From<[f32; 2]> for Size {
+ fn from([width, height]: [f32; 2]) -> Self {
+ Size { width, height }
+ }
+}
+
+impl From<[u16; 2]> for Size {
+ fn from([width, height]: [u16; 2]) -> Self {
+ Size::new(width.into(), height.into())
+ }
+}
diff --git a/native/src/widget/image.rs b/native/src/widget/image.rs
index 4c588c9d..bcfc40b2 100644
--- a/native/src/widget/image.rs
+++ b/native/src/widget/image.rs
@@ -100,6 +100,7 @@ where
}
fn hash_layout(&self, state: &mut Hasher) {
+ self.path.hash(state);
self.width.hash(state);
self.height.hash(state);
}