Box::deref makes the EDN rendering examples really work!

This commit is contained in:
🪞👃🪞 2025-01-05 16:37:06 +01:00
parent ea8ba031c3
commit 62a0e8c17c
9 changed files with 103 additions and 92 deletions

View file

@ -19,6 +19,14 @@ pub trait Size<N: Coordinate>: From<[N;2]> + Debug + Copy {
#[inline] fn zero () -> [N;2] {
[N::zero(), N::zero()]
}
#[inline] fn to_area_pos (&self) -> [N;4] {
let [x, y] = self.wh();
[x, y, 0.into(), 0.into()]
}
#[inline] fn to_area_size (&self) -> [N;4] {
let [w, h] = self.wh();
[0.into(), 0.into(), w, h]
}
}
impl<N: Coordinate> Size<N> for (N, N) {