refactor(tracker/gioui): use precreated hex strings in OrderEditor

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2025-06-24 19:10:29 +03:00
parent 17ca15b205
commit 7a030683c6

View File

@ -1,11 +1,9 @@
package gioui package gioui
import ( import (
"fmt"
"image" "image"
"math" "math"
"strconv" "strconv"
"strings"
"gioui.org/f32" "gioui.org/f32"
"gioui.org/io/event" "gioui.org/io/event"
@ -89,7 +87,7 @@ func (oe *OrderEditor) Layout(gtx C, t *Tracker) D {
callOp = loopMarkerColorOp callOp = loopMarkerColorOp
} }
defer op.Offset(image.Pt(0, -2)).Push(gtx.Ops).Pop() defer op.Offset(image.Pt(0, -2)).Push(gtx.Ops).Pop()
widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, t.Theme.OrderEditor.RowTitle.Font, t.Theme.OrderEditor.RowTitle.TextSize, strings.ToUpper(fmt.Sprintf("%02x", j)), callOp) widget.Label{}.Layout(gtx, t.Theme.Material.Shaper, t.Theme.OrderEditor.RowTitle.Font, t.Theme.OrderEditor.RowTitle.TextSize, hexStr[j&255], callOp)
return D{Size: image.Pt(w, gtx.Dp(patternCellHeight))} return D{Size: image.Pt(w, gtx.Dp(patternCellHeight))}
} }