mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
5 compile errors left
This commit is contained in:
parent
7bcd40b425
commit
b3f0f60400
13 changed files with 462 additions and 180 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue