mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
fix(tracker): adding order row moved cursor incorrectly
This commit is contained in:
parent
1c42a51cc6
commit
025f8832d9
@ -336,7 +336,7 @@ func (m *Model) StopPlaying() Action {
|
|||||||
func (m *Model) AddOrderRow(before bool) Action {
|
func (m *Model) AddOrderRow(before bool) Action {
|
||||||
return Allow(func() {
|
return Allow(func() {
|
||||||
defer m.change("AddOrderRowAction", ScoreChange, MinorChange)()
|
defer m.change("AddOrderRowAction", ScoreChange, MinorChange)()
|
||||||
if before {
|
if !before {
|
||||||
m.d.Cursor.OrderRow++
|
m.d.Cursor.OrderRow++
|
||||||
}
|
}
|
||||||
m.d.Cursor2.OrderRow = m.d.Cursor.OrderRow
|
m.d.Cursor2.OrderRow = m.d.Cursor.OrderRow
|
||||||
|
@ -186,11 +186,7 @@ func (oe *OrderEditor) command(t *Tracker, e key.Event) {
|
|||||||
t.Model.DeleteOrderRow(false).Do()
|
t.Model.DeleteOrderRow(false).Do()
|
||||||
}
|
}
|
||||||
case key.NameReturn:
|
case key.NameReturn:
|
||||||
if e.Modifiers.Contain(key.ModShortcut) {
|
t.Model.AddOrderRow(e.Modifiers.Contain(key.ModShortcut)).Do()
|
||||||
oe.scrollTable.Table.MoveCursor(0, -1)
|
|
||||||
oe.scrollTable.Table.SetCursor2(oe.scrollTable.Table.Cursor())
|
|
||||||
}
|
|
||||||
t.Model.AddOrderRow(!e.Modifiers.Contain(key.ModShortcut)).Do()
|
|
||||||
}
|
}
|
||||||
if iv, err := strconv.Atoi(string(e.Name)); err == nil {
|
if iv, err := strconv.Atoi(string(e.Name)); err == nil {
|
||||||
t.Model.Order().SetValue(oe.scrollTable.Table.Cursor(), iv)
|
t.Model.Order().SetValue(oe.scrollTable.Table.Cursor(), iv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user