mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-10-08 18:56:42 +02:00
colorize; show editor
This commit is contained in:
parent
9a50ce6613
commit
ea74aba7b7
3 changed files with 79 additions and 60 deletions
|
|
@ -283,7 +283,7 @@ impl PianoHorizontal {
|
|||
let mut range = MidiSelection::from((12, true));
|
||||
range.time_axis = size.0.clone();
|
||||
range.note_axis = size.1.clone();
|
||||
let piano = Self { keys_width: 5, size, range, ..Default::default() };
|
||||
let piano = Self { keys_width: 4, size, range, ..Default::default() };
|
||||
piano.redraw();
|
||||
piano
|
||||
}
|
||||
|
|
@ -320,17 +320,7 @@ impl MidiViewer for PianoHorizontal {
|
|||
}
|
||||
/// Draw the piano roll into the buffer.
|
||||
fn redraw (&self) {
|
||||
*self.buffer.write() = self.clip.map_inner(|clip|{
|
||||
let buf_size = self.buffer_size(&clip);
|
||||
let mut buffer = BigBuffer::from(buf_size);
|
||||
let time_zoom = self.get_time_zoom().max(1);
|
||||
self.time_len().store(clip.length, Relaxed);
|
||||
let note_len = self.get_note_len();
|
||||
let note_pos = self.get_note_pos();
|
||||
let time_pos = self.get_time_pos();
|
||||
draw_piano_fg(&mut buffer, &clip, time_zoom);
|
||||
buffer
|
||||
}).unwrap_or_default()
|
||||
*self.buffer.write() = redraw_piano(&self)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue