fix(tracker): unit searching to work more reliably

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-02-17 20:54:46 +02:00
parent db6c9f6052
commit 2b3f6d8200
7 changed files with 39 additions and 15 deletions

View File

@ -29,6 +29,7 @@ type (
ParamIndex int
UnitSearchIndex int
UnitSearchString string
UnitSearching bool
Octave int
Step int
FilePath string
@ -222,6 +223,8 @@ func (m *Model) change(kind string, t ChangeType, severity ChangeSeverity) func(
}
m.d.UnitIndex = clamp(m.d.UnitIndex, 0, unitCount-1)
m.d.UnitIndex2 = clamp(m.d.UnitIndex2, 0, unitCount-1)
m.d.UnitSearching = false // if we change anything in the patch, reset the unit searching
m.d.UnitSearchString = ""
m.send(m.d.Song.Patch.Copy())
}
if m.changeType&BPMChange != 0 {