add From<Point> and From<Size> for [f32; 2]

This commit is contained in:
Azorlogh 2020-10-08 09:54:22 +02:00
parent 2e0ba65a20
commit e6bcb7211f
2 changed files with 12 additions and 0 deletions

View file

@ -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]
}
}