mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
call autoscroll before render instead of on move
This commit is contained in:
parent
a2a6ea1260
commit
c1da3fac13
1 changed files with 4 additions and 3 deletions
|
|
@ -90,11 +90,9 @@ impl Command<PhraseEditorModel> for PhraseCommand {
|
||||||
SetNoteLength(x) => { state.set_note_len(x); },
|
SetNoteLength(x) => { state.set_note_len(x); },
|
||||||
SetTimeCursor(x) => {
|
SetTimeCursor(x) => {
|
||||||
state.set_time_point(x);
|
state.set_time_point(x);
|
||||||
state.autoscroll();
|
|
||||||
},
|
},
|
||||||
SetNoteCursor(note) => {
|
SetNoteCursor(note) => {
|
||||||
state.set_note_point(note.min(127));
|
state.set_note_point(note.min(127));
|
||||||
state.autoscroll();
|
|
||||||
},
|
},
|
||||||
_ => todo!("{:?}", self)
|
_ => todo!("{:?}", self)
|
||||||
}
|
}
|
||||||
|
|
@ -118,7 +116,10 @@ impl Default for PhraseEditorModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
has_size!(<Tui>|self:PhraseEditorModel|&self.size);
|
has_size!(<Tui>|self:PhraseEditorModel|&self.size);
|
||||||
render!(<Tui>|self: PhraseEditorModel|&self.mode);
|
render!(<Tui>|self: PhraseEditorModel|{
|
||||||
|
self.autoscroll();
|
||||||
|
&self.mode
|
||||||
|
});
|
||||||
//render!(<Tui>|self: PhraseEditorModel|lay!(|add|{add(&self.size)?;add(self.mode)}));//bollocks
|
//render!(<Tui>|self: PhraseEditorModel|lay!(|add|{add(&self.size)?;add(self.mode)}));//bollocks
|
||||||
|
|
||||||
pub trait PhraseViewMode: Render<Tui> + HasSize<Tui> + MidiRange + MidiPoint + Debug + Send + Sync {
|
pub trait PhraseViewMode: Render<Tui> + HasSize<Tui> + MidiRange + MidiPoint + Debug + Send + Sync {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue