mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
fix note cursor length and advancement
This commit is contained in:
parent
98fa0c4c4f
commit
35599c6cde
3 changed files with 17 additions and 14 deletions
|
|
@ -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(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue