full block piano roll, pt.4

This commit is contained in:
🪞👃🪞 2024-12-04 01:10:18 +01:00
parent 501e47cd85
commit f2fdf3dd12

View file

@ -267,11 +267,16 @@ impl PhraseViewMode {
for (x, target_x) in (x0..x0+w).enumerate() {
for (y, target_y) in (y0..y0+h).enumerate() {
let source_x = time_start + x;
let source_y = note_hi - y;
let target_cell = target.get_mut(target_x, target_y);
target_cell.set_char('x');
if let Some(source_cell) = source.get(source_x, source_y) {
*target_cell = source_cell.clone();
let source_y = note_hi - y;
// TODO: enable loop rollover:
//let source_x = (time_start + x) % source.width.max(1);
//let source_y = (note_hi - y) % source.height.max(1);
if source_x < source.width && source_y < source.height {
let target_cell = target.get_mut(target_x, target_y);
target_cell.set_char('x');
if let Some(source_cell) = source.get(source_x, source_y) {
*target_cell = source_cell.clone();
}
}
}
}