add Measure::of

This commit is contained in:
🪞👃🪞 2025-01-02 14:11:32 +01:00
parent 6b073988c2
commit 5b57f2b998
4 changed files with 21 additions and 54 deletions

View file

@ -5,13 +5,14 @@ pub struct PianoHorizontalNotes<'a>(pub(crate) &'a PianoHorizontal);
render!(Tui: |self: PianoHorizontalNotes<'a>, render|{
let time_start = self.0.time_start().get();
let note_axis = self.0.note_axis().get();
let note_lo = self.0.note_lo().get();
let note_hi = self.0.note_hi();
let note_point = self.0.note_point();
let source = &self.0.buffer;
let [x0, y0, w, h] = render.area().xywh();
if h as usize != self.0.note_axis().get() {
panic!("area height mismatch");
if h as usize != note_axis {
panic!("area height mismatch: {h} <> {note_axis}");
}
for (area_x, screen_x) in (x0..x0+w).enumerate() {
for (area_y, screen_y, note) in note_y_iter(note_lo, note_hi, y0) {