draws again!
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
i do not exist 2026-08-23 11:29:48 +03:00
parent f2443a4314
commit 6771b24f79
17 changed files with 105 additions and 96 deletions

View file

@ -24,8 +24,8 @@ pub struct PianoHorizontal {
impl_has!(Sizer: |self: PianoHorizontal| self.size);
impl View<Tui> for PianoHorizontal {
fn view (&self) -> impl Draw<'_, Tui> {
impl Draw<Tui> for PianoHorizontal {
fn draw (&self, to: &mut Tui) -> Drawn<u16> {
south(
east(
format!("{}x{}", self.size.w(), self.size.h()).exact_w(5),
@ -35,7 +35,7 @@ impl View<Tui> for PianoHorizontal {
self.keys(),
self.size.of(below(self.notes().full_wh(), self.cursor().full_wh()))
),
)
).draw(to)
}
}
@ -132,7 +132,7 @@ impl PianoHorizontal {
}
}
fn notes (&self) -> impl Draw<'_, Tui> {
fn notes (&self) -> impl Draw<Tui> {
let time_start = self.get_time_start();
let note_lo = self.get_note_lo();
let note_hi = self.get_note_hi();
@ -168,7 +168,7 @@ impl PianoHorizontal {
})
}
fn cursor (&self) -> impl Draw<'_, Tui> {
fn cursor (&self) -> impl Draw<Tui> {
let note_hi = self.get_note_hi();
let note_lo = self.get_note_lo();
let note_pos = self.get_note_pos();
@ -202,7 +202,7 @@ impl PianoHorizontal {
})
}
fn keys (&self) -> impl Draw<'_, Tui> {
fn keys (&self) -> impl Draw<Tui> {
let state = self;
let color = state.color;
let note_lo = state.get_note_lo();
@ -229,7 +229,7 @@ impl PianoHorizontal {
}).exact_w(self.keys_width).full_h()
}
fn timeline (&self) -> impl Draw<'_, Tui> + '_ {
fn timeline (&self) -> impl Draw<Tui> + '_ {
draw(move|to: &mut Tui|{
let xywh = to.area().into();
let XYWH(x, y, w, _h) = xywh;