summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/point.rs6
-rw-r--r--core/src/size.rs6
2 files changed, 12 insertions, 0 deletions
diff --git a/core/src/point.rs b/core/src/point.rs
index 3714aa2f..7d93538f 100644
--- a/core/src/point.rs
+++ b/core/src/point.rs
@@ -46,6 +46,12 @@ impl From<[u16; 2]> for Point {
}
}
+impl From<Point> for [f32; 2] {
+ fn from(point: Point) -> [f32; 2] {
+ [point.x, point.y]
+ }
+}
+
impl std::ops::Add<Vector> for Point {
type Output = Self;
diff --git a/core/src/size.rs b/core/src/size.rs
index aceb5311..7c481935 100644
--- a/core/src/size.rs
+++ b/core/src/size.rs
@@ -56,3 +56,9 @@ impl From<[u16; 2]> for Size {
Size::new(width.into(), height.into())
}
}
+
+impl From<Size> for [f32; 2] {
+ fn from(size: Size) -> [f32; 2] {
+ [size.width, size.height]
+ }
+}