5 compile errors left

This commit is contained in:
🪞👃🪞 2024-09-07 16:44:49 +03:00
parent 7bcd40b425
commit b3f0f60400
13 changed files with 462 additions and 180 deletions

View file

@ -30,6 +30,13 @@ pub trait Area<N: Number>: Copy {
fn lrtb (&self) -> [N;4] {
[self.x(), self.x2(), self.y(), self.y2()]
}
fn expect_min (&self, w: N, h: N) -> Usually<&Self> {
if self.w() < w || self.h() < h {
Err(format!("min {w}x{h}").into())
} else {
Ok(self)
}
}
}
impl<N: Number> Area<N> for (N, N, N, N) {