wip: and sweeps right through the codebase

This commit is contained in:
🪞👃🪞 2024-12-31 02:03:16 +01:00
parent d37bd3e0c5
commit c9b09b7dea
16 changed files with 370 additions and 625 deletions

View file

@ -63,6 +63,9 @@ pub trait Size<N: Coordinate> {
Ok(self)
}
}
#[inline] fn zero () -> [N;2] {
[N::zero(), N::zero()]
}
}
impl<N: Coordinate> Size<N> for (N, N) {
@ -129,6 +132,10 @@ pub trait Area<N: Coordinate>: Copy {
#[inline] fn shrink_y (&self, y: N) -> [N;4] {
[self.x(), self.y(), self.w(), self.h().minus(y)]
}
fn zero () -> [N;4] {
[N::zero(), N::zero(), N::zero(), N::zero()]
}
}
impl<N: Coordinate> Area<N> for (N, N, N, N) {