colorize phrase cursor

This commit is contained in:
🪞👃🪞 2024-12-23 22:37:41 +01:00
parent d042285c80
commit 1408c0c3ce

View file

@ -130,6 +130,7 @@ render!(<Tui>|self: PianoHorizontalKeys<'a>|render(|to|Ok({
pub struct PianoHorizontalCursor<'a>(&'a PianoHorizontal);
render!(<Tui>|self: PianoHorizontalCursor<'a>|render(|to|Ok({
let style = Some(Style::default().fg(self.0.color.lightest.rgb));
let note_hi = self.0.note_hi();
let note_len = self.0.note_len();
let note_lo = self.0.note_lo().get();
@ -138,7 +139,6 @@ render!(<Tui>|self: PianoHorizontalCursor<'a>|render(|to|Ok({
let time_start = self.0.time_start().get();
let time_zoom = self.0.time_zoom().get();
let [x0, y0, w, _] = to.area().xywh();
let style = Some(Style::default().fg(Color::Rgb(0,255,0)));
for (area_y, screen_y, note) in note_y_iter(note_lo, note_hi, y0) {
if note == note_point {
for x in 0..w {
@ -227,7 +227,7 @@ impl PianoHorizontal {
}
/// Draw the piano roll background using full blocks on note on and half blocks on legato: █▄ █▄ █▄
fn draw_fg (buf: &mut BigBuffer, phrase: &Phrase, zoom: usize) {
let style = Style::default().fg(phrase.color.lightest.rgb);//.bg(Color::Rgb(0, 0, 0));
let style = Style::default().fg(phrase.color.base.rgb);//.bg(Color::Rgb(0, 0, 0));
let mut notes_on = [false;128];
for (x, time_start) in (0..phrase.length).step_by(zoom).enumerate() {