pub use euclid::Box2D as Rect; pub use euclid::Point2D as Point; pub use euclid::Size2D as Size; pub use euclid::Vector2D as Vector; pub use quad::Quad; mod quad; pub trait Corners { fn top_left(&self) -> Point; fn top_right(&self) -> Point; fn bottom_left(&self) -> Point; fn bottom_right(&self) -> Point; } impl Corners for Rect where T: Copy, { #[inline] fn top_left(&self) -> Point { self.min } #[inline] fn top_right(&self) -> Point { Point::new(self.max.x, self.min.y) } #[inline] fn bottom_left(&self) -> Point { Point::new(self.min.x, self.max.y) } #[inline] fn bottom_right(&self) -> Point { self.max } }