refactor(tracker): use built-in min & max instead of intMin & intMax

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-10-18 23:43:27 +03:00
parent 0ba6557f65
commit 1c42a51cc6
11 changed files with 58 additions and 72 deletions

View File

@ -254,8 +254,8 @@ func (s *ScrollTable) command(gtx C, e key.Event) {
stepX := 1
stepY := 1
if e.Modifiers.Contain(key.ModAlt) {
stepX = intMax(s.ColTitleList.List.Position.Count-3, 8)
stepY = intMax(s.RowTitleList.List.Position.Count-3, 8)
stepX = max(s.ColTitleList.List.Position.Count-3, 8)
stepY = max(s.RowTitleList.List.Position.Count-3, 8)
} else if e.Modifiers.Contain(key.ModCtrl) {
stepX = 1e6
stepY = 1e6
@ -277,9 +277,9 @@ func (s *ScrollTable) command(gtx C, e key.Event) {
case key.NameRightArrow:
s.Table.MoveCursor(stepX, 0)
case key.NamePageUp:
s.Table.MoveCursor(0, -intMax(s.RowTitleList.List.Position.Count-3, 8))
s.Table.MoveCursor(0, -max(s.RowTitleList.List.Position.Count-3, 8))
case key.NamePageDown:
s.Table.MoveCursor(0, intMax(s.RowTitleList.List.Position.Count-3, 8))
s.Table.MoveCursor(0, max(s.RowTitleList.List.Position.Count-3, 8))
case key.NameHome:
s.Table.SetCursorX(0)
case key.NameEnd: