mirror of
https://github.com/vsariola/sointu.git
synced 2025-11-18 16:49:06 -05:00
feat(tracker): do not wrap around when playing or moving cursor
The wrapping was usually unwanted behaviour. The user can use the looping (Ctrl-L) to loop the song forever if this is really desired.
This commit is contained in:
parent
5e65410d27
commit
877556b428
@ -410,7 +410,7 @@ func (m *Notes) Cursor2() Point {
|
||||
|
||||
func (v *Notes) SetCursor(p Point) {
|
||||
v.d.Cursor.Track = intMax(intMin(p.X, len(v.d.Song.Score.Tracks)-1), 0)
|
||||
newPos := v.d.Song.Score.Wrap(sointu.SongPos{PatternRow: p.Y})
|
||||
newPos := v.d.Song.Score.Clamp(sointu.SongPos{PatternRow: p.Y})
|
||||
if newPos != v.d.Cursor.SongPos {
|
||||
v.noteTracking = false
|
||||
}
|
||||
@ -419,7 +419,7 @@ func (v *Notes) SetCursor(p Point) {
|
||||
|
||||
func (v *Notes) SetCursor2(p Point) {
|
||||
v.d.Cursor2.Track = intMax(intMin(p.X, len(v.d.Song.Score.Tracks)-1), 0)
|
||||
v.d.Cursor2.SongPos = v.d.Song.Score.Wrap(sointu.SongPos{PatternRow: p.Y})
|
||||
v.d.Cursor2.SongPos = v.d.Song.Score.Clamp(sointu.SongPos{PatternRow: p.Y})
|
||||
}
|
||||
|
||||
func (v *Notes) Width() int {
|
||||
|
||||
Reference in New Issue
Block a user