fix(tracker/gioui): advance row by step when inputting a note

Closes #144.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-09-07 17:45:32 +03:00
parent 1daaf1829c
commit 4e1fdf57d9
2 changed files with 11 additions and 0 deletions

View File

@ -341,6 +341,10 @@ func noteAsValue(octave, note int) byte {
func (te *NoteEditor) command(gtx C, t *Tracker, e key.Event) {
if e.Name == "A" || e.Name == "1" {
t.Model.Notes().Table().Fill(0)
if step := t.Model.Step().Value(); step > 0 {
te.scrollTable.Table.MoveCursor(0, step)
te.scrollTable.Table.SetCursor2(te.scrollTable.Table.Cursor())
}
te.scrollTable.EnsureCursorVisible()
return
}
@ -360,6 +364,10 @@ func (te *NoteEditor) command(gtx C, t *Tracker, e key.Event) {
}
return
validNote:
if step := t.Model.Step().Value(); step > 0 {
te.scrollTable.Table.MoveCursor(0, step)
te.scrollTable.Table.SetCursor2(te.scrollTable.Table.Cursor())
}
te.scrollTable.EnsureCursorVisible()
if _, ok := t.KeyPlaying[e.Name]; !ok {
trk := te.scrollTable.Table.Cursor().X