wip: impl_draw, optional drawing

This commit is contained in:
facile pop culture reference 2026-07-06 05:35:48 +03:00
parent 0b9e9c0696
commit bf16288884
12 changed files with 213 additions and 229 deletions

View file

@ -23,7 +23,7 @@ pub const fn border (on: bool, style: impl BorderStyle, draw: impl Draw<Tui>) ->
to.blit(&style.border_e(), x + w - 1, y, style.style());
}
}
Ok(XYWH(x, y, w, h))
Ok(Some(XYWH(x, y, w, h)))
}));
above(outline, content)
}
@ -48,7 +48,7 @@ macro_rules! border {
#[derive(Copy, Clone)] pub struct $T(pub bool, pub Style);
//impl Layout<Tui> for $T {}
impl Draw<Tui> for $T {
fn draw (self, to: &mut Tui) -> Usually<XYWH<u16>> {
fn draw (self, to: &mut Tui) -> Perhaps<XYWH<u16>> {
when(self.enabled(), thunk(|to: &mut Tui|BorderStyle::draw(self, to))).draw(to)
}
}