somehow it is now aligned

This commit is contained in:
🪞👃🪞 2025-01-11 16:30:15 +01:00
parent d9f1875c03
commit ba0ff4af98
5 changed files with 49 additions and 40 deletions

View file

@ -75,6 +75,13 @@ fn match_exp <'a, E: Output + 'a, State: EdnViewData<E>> (
) -> Box<dyn Render<E> + 'a> {
match (head, tail) {
(Key("when"), [c, a]) => When(s.get_bool(c.to_ref()),
s.get_content(a.to_ref())).boxed(),
(Key("either"),[c, a, b]) => Either(s.get_bool(c.to_ref()),
s.get_content(a.to_ref()),
s.get_content(b.to_ref())).boxed(),
(Key("align/c"), [a]) => Align::c(s.get_content(a.to_ref())).boxed(),
(Key("align/x"), [a]) => Align::x(s.get_content(a.to_ref())).boxed(),
(Key("align/y"), [a]) => Align::y(s.get_content(a.to_ref())).boxed(),
@ -94,12 +101,12 @@ fn match_exp <'a, E: Output + 'a, State: EdnViewData<E>> (
(Key("bsp/s"), [a, b]) => Bsp::s(s.get_content(a.to_ref()), s.get_content(b.to_ref()),).boxed(),
(Key("bsp/w"), [a, b]) => Bsp::w(s.get_content(a.to_ref()), s.get_content(b.to_ref()),).boxed(),
(Key("fill/x"), [a]) => Fill::x(s.get_content(a.to_ref())).boxed(),
(Key("fill/y"), [a]) => Fill::y(s.get_content(a.to_ref())).boxed(),
(Key("fill/xy"), [a]) => Fill::xy(s.get_content(a.to_ref())).boxed(),
(Key("fill/x"), [a]) => Fill::x(s.get_content(a.to_ref())).boxed(),
(Key("fill/y"), [a]) => Fill::y(s.get_content(a.to_ref())).boxed(),
(Key("fill/xy"), [a]) => Fill::xy(s.get_content(a.to_ref())).boxed(),
(Key("fixed/x"), [x, a]) => Fixed::x(s.get_unit(x.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("fixed/y"), [y, a]) => Fixed::y(s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("fixed/x"), [x, a]) => Fixed::x(s.get_unit(x.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("fixed/y"), [y, a]) => Fixed::y(s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("fixed/xy"), [x, y, a]) => Fixed::xy(s.get_unit(x.to_ref()), s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("max/x"), [x, a]) => Max::x(s.get_unit(x.to_ref()), s.get_content(a.to_ref())).boxed(),
@ -108,7 +115,13 @@ fn match_exp <'a, E: Output + 'a, State: EdnViewData<E>> (
(Key("push/x"), [x, a]) => Push::x(s.get_unit(x.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("push/y"), [y, a]) => Push::y(s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("when"), [c, a]) => When(s.get_bool(c.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("pad/x"), [x, a]) => Padding::x(s.get_unit(x.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("pad/y"), [y, a]) => Padding::y(s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("pad/xy"), [x, y, a]) => Padding::xy(s.get_unit(x.to_ref()), s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("grow/x"), [x, a]) => Margin::x(s.get_unit(x.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("grow/y"), [y, a]) => Margin::y(s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
(Key("grow/xy"), [x, y, a]) => Margin::xy(s.get_unit(x.to_ref()), s.get_unit(y.to_ref()), s.get_content(a.to_ref())).boxed(),
_ => todo!("{:?} {:?}", &head, &tail)
}