auto redraw phrase on create editor

This commit is contained in:
🪞👃🪞 2024-12-18 19:26:21 +01:00
parent 326507f400
commit 72dd3756db
2 changed files with 5 additions and 2 deletions

View file

@ -34,7 +34,7 @@ from_jack!(|jack| ArrangerTui {
color: TuiTheme::bg().into(), color: TuiTheme::bg().into(),
mode: ArrangerMode::V(1), mode: ArrangerMode::V(1),
size: Measure::new(), size: Measure::new(),
splits: [16, 20], splits: [12, 20],
midi_buf: vec![vec![];65536], midi_buf: vec![vec![];65536],
note_buf: vec![], note_buf: vec![],
perf: PerfModel::default(), perf: PerfModel::default(),

View file

@ -210,7 +210,9 @@ impl PhraseEditorModel {
impl From<&Arc<RwLock<Phrase>>> for PhraseEditorModel { impl From<&Arc<RwLock<Phrase>>> for PhraseEditorModel {
fn from (phrase: &Arc<RwLock<Phrase>>) -> Self { fn from (phrase: &Arc<RwLock<Phrase>>) -> Self {
Self::from(Some(phrase.clone())) let mut model = Self::from(Some(phrase.clone()));
model.redraw();
model
} }
} }
@ -218,6 +220,7 @@ impl From<Option<Arc<RwLock<Phrase>>>> for PhraseEditorModel {
fn from (phrase: Option<Arc<RwLock<Phrase>>>) -> Self { fn from (phrase: Option<Arc<RwLock<Phrase>>>) -> Self {
let mut model = Self::default(); let mut model = Self::default();
*model.phrase_mut() = phrase; *model.phrase_mut() = phrase;
model.redraw();
model model
} }
} }