mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-23 17:35:00 +00:00
Add From<((left,right), (top, bottom))> to Vec4
This commit is contained in:
parent
14c6d4fb82
commit
e81a569e31
12
src/vec.rs
12
src/vec.rs
@ -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 {
|
impl<T: Into<Vec4>> Add<T> for Vec4 {
|
||||||
type Output = Vec4;
|
type Output = Vec4;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user