fix note cursor length and advancement

This commit is contained in:
🪞👃🪞 2024-10-23 20:31:20 +03:00
parent 98fa0c4c4f
commit 35599c6cde
3 changed files with 17 additions and 14 deletions

View file

@ -88,10 +88,13 @@ impl Content for PhraseEditor<Tui> {
if *entered {
let area = to.area();
if let (Some(time), Some(note)) = (time_axis.point, note_axis.point) {
let x = area.x() + (time / time_axis.scale) as u16;
let x1 = area.x() + (time / time_axis.scale) as u16;
let x2 = x1 + (self.note_len / time_axis.scale) as u16;
let y = area.y() + 1 + note as u16 / 2;
let c = if note % 2 == 0 { "" } else { "" };
to.blit(&c, x, y, Some(Style::default().fg(color)));
for x in x1..x2 {
to.blit(&c, x, y, Some(Style::default().fg(color)));
}
}
}
Ok(())