mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-01-13 19:36:41 +01:00
Box::deref makes the EDN rendering examples really work!
This commit is contained in:
parent
ea8ba031c3
commit
62a0e8c17c
9 changed files with 103 additions and 92 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue