display clamps; pass amount to axis inc/dec

This commit is contained in:
🪞👃🪞 2024-10-23 01:14:09 +03:00
parent 694aed6d9b
commit 27b1c27891
3 changed files with 24 additions and 26 deletions

View file

@ -89,27 +89,23 @@ impl Handle<Tui> for PhraseEditor<Tui> {
key!(KeyCode::Char('`')) => { self.mode = !self.mode; },
key!(KeyCode::Enter) => { self.entered = true; },
key!(KeyCode::Esc) => { self.entered = false; },
key!(KeyCode::PageUp) => {
self.note_axis.start = self.note_axis.start.saturating_sub(3);
}
key!(KeyCode::PageDown) => {
self.note_axis.start = self.note_axis.start + 3;
}
key!(KeyCode::PageUp) => { self.note_axis.start_dec(3); },
key!(KeyCode::PageDown) => { self.note_axis.start_inc(3); },
key!(KeyCode::Up) => match self.entered {
true => { self.note_axis.point_dec(); },
false => { self.note_axis.start_dec(); },
true => { self.note_axis.point_dec(1); },
false => { self.note_axis.start_dec(1); },
},
key!(KeyCode::Down) => match self.entered {
true => { self.note_axis.point_inc(); },
false => { self.note_axis.start_inc(); },
true => { self.note_axis.point_inc(1); },
false => { self.note_axis.start_inc(1); },
},
key!(KeyCode::Left) => match self.entered {
true => { self.time_axis.point_dec(); },
false => { self.time_axis.start_dec(); },
true => { self.time_axis.point_dec(self.time_axis.scale); },
false => { self.time_axis.start_dec(self.time_axis.scale); },
},
key!(KeyCode::Right) => match self.entered {
true => { self.time_axis.point_inc(); },
false => { self.time_axis.start_inc(); },
true => { self.time_axis.point_inc(self.time_axis.scale); },
false => { self.time_axis.start_inc(self.time_axis.scale); },
},
key!(KeyCode::Char('>')) => {
self.time_axis.scale = prev_note_length(self.time_axis.scale)