mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-20 22:14:35 -04:00
fix(tracker): click on hex track low/high nibble selects that nibble
Closes #160
This commit is contained in:
parent
5099c61705
commit
7470413ad8
@ -1,6 +1,8 @@
|
||||
package tracker
|
||||
|
||||
import (
|
||||
"math"
|
||||
|
||||
"github.com/vsariola/sointu"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
@ -15,6 +17,7 @@ type (
|
||||
Cursor2() Point
|
||||
SetCursor(Point)
|
||||
SetCursor2(Point)
|
||||
SetCursorFloat(x, y float32)
|
||||
Width() int
|
||||
Height() int
|
||||
MoveCursor(dx, dy int) (ok bool)
|
||||
@ -178,6 +181,10 @@ func (m *Order) SetCursor2(p Point) {
|
||||
m.updateCursorRows()
|
||||
}
|
||||
|
||||
func (m *Order) SetCursorFloat(x, y float32) {
|
||||
m.SetCursor(Point{int(x), int(y)})
|
||||
}
|
||||
|
||||
func (v *Order) updateCursorRows() {
|
||||
if v.Cursor() == v.Cursor2() {
|
||||
v.d.Cursor.PatternRow = 0
|
||||
@ -422,6 +429,11 @@ func (v *Notes) SetCursor2(p Point) {
|
||||
v.d.Cursor2.SongPos = v.d.Song.Score.Clamp(sointu.SongPos{PatternRow: p.Y})
|
||||
}
|
||||
|
||||
func (m *Notes) SetCursorFloat(x, y float32) {
|
||||
m.SetCursor(Point{int(x), int(y)})
|
||||
m.d.LowNibble = math.Mod(float64(x), 1.0) > 0.5
|
||||
}
|
||||
|
||||
func (v *Notes) Width() int {
|
||||
return len((*Model)(v).d.Song.Score.Tracks)
|
||||
}
|
||||
|
Reference in New Issue
Block a user