Add From<((left,right), (top, bottom))> to Vec4

This commit is contained in:
Alexandre Bury 2016-10-12 15:37:35 -07:00
parent 14c6d4fb82
commit e81a569e31

View File

@ -215,6 +215,18 @@ impl From<(i32, i32, i32, i32)> for Vec4 {
}
}
impl From<((i32, i32), (i32, i32))> for Vec4 {
fn from(((left, right), (top, bottom)): ((i32, i32), (i32, i32))) -> Vec4 {
(left, right, top, bottom).into()
}
}
impl From<((usize, usize), (usize, usize))> for Vec4 {
fn from(((left, right), (top, bottom)): ((usize, usize), (usize, usize)))
-> Vec4 {
(left, right, top, bottom).into()
}
}
impl<T: Into<Vec4>> Add<T> for Vec4 {
type Output = Vec4;