cleanup Engine API and generalize Inset/Outset

This commit is contained in:
🪞👃🪞 2024-09-13 21:27:40 +03:00
parent 4e0eb0c335
commit 0737769232
6 changed files with 118 additions and 91 deletions

View file

@ -407,9 +407,11 @@ impl<'a> Widget for RowSeparators<'a> {
break
}
for x in area.x()..area.x2().saturating_sub(2) {
let cell = to.buffer().get_mut(x, y);
cell.modifier = Modifier::UNDERLINED;
cell.underline_color = Nord::SEPARATOR;
if x < to.buffer().area.x && y < to.buffer().area.y {
let cell = to.buffer().get_mut(x, y);
cell.modifier = Modifier::UNDERLINED;
cell.underline_color = Nord::SEPARATOR;
}
}
}
Ok(Some(area))

View file

@ -412,7 +412,7 @@ impl Sequencer<Tui> {
add(&SequenceLoopRange)?;
add(&SequenceNoteRange)?;
Ok(())
}).render(to.with_area(area.x(), area.y(), 10, area.h()))?;
}).render(to.with_rect([area.x(), area.y(), 10, area.h()]))?;
let area = [area.x() + 10, area.y(), area.w().saturating_sub(10), area.h().min(66)];
Lozenge(Style::default().fg(Nord::BG2)).draw(to.with_rect(area))?;
let area = [area.x() + 1, area.y(), area.w().saturating_sub(1), area.h()];