down to 28e, sane ones

This commit is contained in:
🪞👃🪞 2024-12-31 15:50:53 +01:00
parent 46609855eb
commit 16e6a0397c
15 changed files with 91 additions and 87 deletions

View file

@ -121,8 +121,8 @@ impl<E: Engine, X: Content<E>, Y: Content<E>> Default for Bsp<E, X, Y> {
impl<E: Engine, X: Content<E>, Y: Content<E>> Content<E> for Bsp<E, X, Y> {
fn render (&self, to: &mut E::Output) {
let n = E::Size::zero();
let s = to.wh();
let _n = E::Size::zero();
let _s = to.wh();
match self {
Self::Null(_) => {},
//Self::S(p, a, b) => {

View file

@ -25,13 +25,13 @@ macro_rules! transform_xy {
pub fn xy (item: T) -> Self { Self::XY(item) }
}
impl<E: Engine, T: Content<E>> Content<E> for $Enum<E, T> {
fn content (&self) -> Option<impl Content<E>> {
Some(match self {
fn content (&self) -> impl Content<E> {
match self {
Self::X(item) => item,
Self::Y(item) => item,
Self::XY(item) => item,
_ => unreachable!()
})
}
}
fn area (&$self, $to: <E as Engine>::Area) -> <E as Engine>::Area {
$area
@ -42,7 +42,7 @@ macro_rules! transform_xy {
transform_xy!(self: Fill |to|{
let [x0, y0, wmax, hmax] = to.xywh();
let [x, y, w, h] = self.content().unwrap().area(to).xywh();
let [x, y, w, h] = self.content().area(to).xywh();
return match self {
Self::X(_) => [x0, y, wmax, h],
Self::Y(_) => [x, y0, w, hmax],
@ -78,7 +78,7 @@ macro_rules! transform_xy_unit {
}
}
impl<E: Engine, T: Content<E>> Content<E> for $Enum<E, T> {
fn content (&self) -> Option<impl Content<E>> {
fn content (&self) -> impl Content<E> {
Some(match self {
Self::X(_, content) => content,
Self::Y(_, content) => content,