wip: slowly putting it back together

This commit is contained in:
🪞👃🪞 2024-09-04 22:39:43 +03:00
parent 7fbb40fad6
commit 461c60d6b3
18 changed files with 788 additions and 774 deletions

View file

@ -9,19 +9,19 @@ impl<'a, T, U> Layered<'a, T, U> {
}
impl<'a, T, U> Collect<'a, T, U> for Layered<'a, T, U> {
fn add_box (mut self, item: Box<dyn Render<'a, T, U> + 'a>) -> Self {
fn add_box (mut self, item: Box<dyn Render<T, U> + 'a>) -> Self {
self.0 = self.0.add_box(item);
self
}
fn add_ref (mut self, item: &'a dyn Render<'a, T, U>) -> Self {
fn add_ref (mut self, item: &'a dyn Render<T, U>) -> Self {
self.0 = self.0.add_ref(item);
self
}
}
impl<'a, 'b> Render<'a, TuiOutput<'b>, Rect> for Layered<'a, TuiOutput<'b>, Rect> {
fn render (&self, to: &'a mut TuiOutput<'b>) -> Perhaps<Rect> {
let area = to.area;
impl<'a> Render<TuiContext, Rect> for Layered<'a, TuiContext, Rect> {
fn render (&self, to: &mut impl TuiTarget) -> Perhaps<Rect> {
let area = to.area();
for layer in self.0.0.iter() {
layer.render(to)?;
}