add From<Point> and From<Size> for [f32; 2]
This commit is contained in:
parent
2e0ba65a20
commit
e6bcb7211f
@ -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 {
|
impl std::ops::Add<Vector> for Point {
|
||||||
type Output = Self;
|
type Output = Self;
|
||||||
|
|
||||||
|
@ -56,3 +56,9 @@ impl From<[u16; 2]> for Size {
|
|||||||
Size::new(width.into(), height.into())
|
Size::new(width.into(), height.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Size> for [f32; 2] {
|
||||||
|
fn from(size: Size) -> [f32; 2] {
|
||||||
|
[size.width, size.height]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user