Merge branch 'master' into feature/image-from-bytes

This commit is contained in:
Héctor Ramón Jiménez 2019-12-04 04:01:12 +01:00
commit 561c3641c6
24 changed files with 454 additions and 166 deletions

View file

@ -27,3 +27,9 @@ impl Length {
}
}
}
impl From<u16> for Length {
fn from(units: u16) -> Self {
Length::Units(units)
}
}

View file

@ -19,6 +19,18 @@ impl Point {
}
}
impl From<[f32; 2]> for Point {
fn from([x, y]: [f32; 2]) -> Self {
Point { x, y }
}
}
impl From<[u16; 2]> for Point {
fn from([x, y]: [u16; 2]) -> Self {
Point::new(x.into(), y.into())
}
}
impl std::ops::Add<Vector> for Point {
type Output = Self;