mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-19 21:44:38 -04:00
refactor(tracker): remove SetCursorFloat method from TableData
This commit is contained in:
parent
430b01d143
commit
840fe3ef0e
@ -159,9 +159,10 @@ func (s *ScrollTableStyle) handleEvents(gtx layout.Context, p image.Point) {
|
|||||||
dy := (e.Position.Y + float32(s.ScrollTable.RowTitleList.List.Position.Offset)) / float32(gtx.Dp(s.CellHeight))
|
dy := (e.Position.Y + float32(s.ScrollTable.RowTitleList.List.Position.Offset)) / float32(gtx.Dp(s.CellHeight))
|
||||||
x := dx + float32(s.ScrollTable.ColTitleList.List.Position.First)
|
x := dx + float32(s.ScrollTable.ColTitleList.List.Position.First)
|
||||||
y := dy + float32(s.ScrollTable.RowTitleList.List.Position.First)
|
y := dy + float32(s.ScrollTable.RowTitleList.List.Position.First)
|
||||||
s.ScrollTable.Table.SetCursor2(tracker.Point{X: int(x), Y: int(y)})
|
cursorPoint := tracker.Point{X: int(x), Y: int(y)}
|
||||||
|
s.ScrollTable.Table.SetCursor2(cursorPoint)
|
||||||
if e.Kind == pointer.Press && !e.Modifiers.Contain(key.ModShift) {
|
if e.Kind == pointer.Press && !e.Modifiers.Contain(key.ModShift) {
|
||||||
s.ScrollTable.Table.SetCursorFloat(x, y)
|
s.ScrollTable.Table.SetCursor(cursorPoint)
|
||||||
}
|
}
|
||||||
s.ScrollTable.cursorMoved = true
|
s.ScrollTable.cursorMoved = true
|
||||||
case pointer.Release:
|
case pointer.Release:
|
||||||
|
@ -18,7 +18,6 @@ type (
|
|||||||
Cursor2() Point
|
Cursor2() Point
|
||||||
SetCursor(Point)
|
SetCursor(Point)
|
||||||
SetCursor2(Point)
|
SetCursor2(Point)
|
||||||
SetCursorFloat(x, y float32)
|
|
||||||
Width() int
|
Width() int
|
||||||
Height() int
|
Height() int
|
||||||
MoveCursor(dx, dy int) (ok bool)
|
MoveCursor(dx, dy int) (ok bool)
|
||||||
@ -189,10 +188,6 @@ func (m *Order) SetCursor2(p Point) {
|
|||||||
m.updateCursorRows()
|
m.updateCursorRows()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Order) SetCursorFloat(x, y float32) {
|
|
||||||
m.SetCursor(Point{int(x), int(y)})
|
|
||||||
}
|
|
||||||
|
|
||||||
func (v *Order) updateCursorRows() {
|
func (v *Order) updateCursorRows() {
|
||||||
if v.Cursor() == v.Cursor2() {
|
if v.Cursor() == v.Cursor2() {
|
||||||
v.d.Cursor.PatternRow = 0
|
v.d.Cursor.PatternRow = 0
|
||||||
|
Reference in New Issue
Block a user