sensible arranger entrypoint! now let's see whats up with the align modifiers

This commit is contained in:
🪞👃🪞 2025-01-07 21:11:56 +01:00
parent 0ee3059cf8
commit f052891473
7 changed files with 180 additions and 105 deletions

View file

@ -46,7 +46,6 @@ impl Content<TuiOut> for RepeatV<'_> {
}
fn render (&self, to: &mut TuiOut) {
let [x, y, w, h] = to.area().xywh();
let a = self.0.len();
for y in y..y+h {
if let Some(cell) = to.buffer.cell_mut(ratatui::prelude::Position::from((x, y))) {
cell.set_symbol(&self.0);
@ -54,3 +53,19 @@ impl Content<TuiOut> for RepeatV<'_> {
}
}
}
pub struct RepeatH<'a>(pub &'a str);
impl Content<TuiOut> for RepeatH<'_> {
fn layout (&self, to: [u16;4]) -> [u16;4] {
to
}
fn render (&self, to: &mut TuiOut) {
let [x, y, w, h] = to.area().xywh();
for x in x..x+w {
if let Some(cell) = to.buffer.cell_mut(ratatui::prelude::Position::from((x, y))) {
cell.set_symbol(&self.0);
}
}
}
}