mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
fbpr: fix scroll
This commit is contained in:
parent
b70d7a08a6
commit
d06ae94655
2 changed files with 11 additions and 11 deletions
|
|
@ -111,11 +111,11 @@ impl Command<PhraseEditorModel> for PhraseCommand {
|
|||
None
|
||||
},
|
||||
SetNoteCursor(note) => {
|
||||
let note = 127.min(note);
|
||||
let note = 127.min(note);
|
||||
let start = state.note_lo.load(Ordering::Relaxed);
|
||||
state.note_point.store(note, Ordering::Relaxed);
|
||||
if note < start {
|
||||
state.note_lo.store((note / 2) * 2, Ordering::Relaxed);
|
||||
state.note_lo.store(note, Ordering::Relaxed);
|
||||
}
|
||||
None
|
||||
},
|
||||
|
|
|
|||
|
|
@ -27,11 +27,11 @@ impl<'a, T: HasEditor> From<&'a T> for PhraseView<'a> {
|
|||
//editor.note_lo.store(note_lo, Ordering::Relaxed);
|
||||
//}
|
||||
let mut note_hi = 127.min((note_lo + height).saturating_sub(2));
|
||||
//if note_point > note_hi {
|
||||
//note_lo += note_point - note_hi;
|
||||
//note_hi = note_point;
|
||||
//editor.note_lo.store(note_lo, Ordering::Relaxed);
|
||||
//}
|
||||
if note_point > note_hi {
|
||||
note_lo += note_point - note_hi;
|
||||
note_hi = note_point;
|
||||
editor.note_lo.store(note_lo, Ordering::Relaxed);
|
||||
}
|
||||
Self {
|
||||
focused: state.editor_focused(),
|
||||
entered: state.editor_entered(),
|
||||
|
|
@ -73,12 +73,12 @@ impl<'a> Content for PhraseView<'a> {
|
|||
} = self;
|
||||
|
||||
let upper_left = format!(
|
||||
"{note_hi} {note_hi_name} {}",
|
||||
"╭{note_hi} {note_hi_name} {}",
|
||||
phrase.as_ref().map(|p|p.read().unwrap().name.clone()).unwrap_or(String::new())
|
||||
);
|
||||
|
||||
let lower_left = format!(
|
||||
"{note_lo} {note_lo_name}"
|
||||
"╰{note_lo} {note_lo_name}"
|
||||
);
|
||||
|
||||
let mut lower_right = format!(
|
||||
|
|
@ -144,8 +144,8 @@ impl<'a> Content for PhraseView<'a> {
|
|||
//}
|
||||
Ok(())
|
||||
}).push_x(6).align_sw(),
|
||||
TuiStyle::fg(upper_left.to_string(), title_color).push_x(1).align_nw(),
|
||||
TuiStyle::fg(lower_left.to_string(), title_color).push_x(1).align_sw(),
|
||||
TuiStyle::fg(upper_left.to_string(), title_color).align_nw(),
|
||||
TuiStyle::fg(lower_left.to_string(), title_color).align_sw(),
|
||||
TuiStyle::fg(upper_right.to_string(), title_color).pull_x(1).align_ne().fill_xy(),
|
||||
TuiStyle::fg(lower_right.to_string(), title_color).pull_x(1).align_se().fill_xy(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue