feat(tracker): make beveling follow tightly the edges of widgets, instead of maximum

This commit is contained in:
vsariola
2021-01-07 14:03:55 +02:00
parent 8b23fb5c05
commit c032978f05
3 changed files with 25 additions and 24 deletions

View File

@ -34,17 +34,17 @@ func (t *Tracker) layoutTrack(patterns [][]byte, sequence []byte, active bool, c
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
op.Offset(f32.Pt(0, float32(gtx.Constraints.Max.Y/2)-trackRowHeight)).Add(gtx.Ops)
paint.FillShape(gtx.Ops, panelColor, clip.Rect{Max: image.Pt(gtx.Constraints.Max.X, trackRowHeight)}.Op())
if active {
/*if active {
switch cursorCol {
case 0:
paint.FillShape(gtx.Ops, panelShadeColor, clip.Rect{Max: image.Pt(36, trackRowHeight)}.Op())
//paint.FillShape(gtx.Ops, panelShadeColor, clip.Rect{Max: image.Pt(36, trackRowHeight)}.Op())
case 1, 2:
s := op.Push(gtx.Ops)
op.Offset(f32.Pt(trackWidth/2+float32(cursorCol-1)*10, 0)).Add(gtx.Ops)
paint.FillShape(gtx.Ops, panelShadeColor, clip.Rect{Max: image.Pt(10, trackRowHeight)}.Op())
//paint.FillShape(gtx.Ops, panelShadeColor, clip.Rect{Max: image.Pt(10, trackRowHeight)}.Op())
s.Pop()
}
}
}*/
// TODO: this is a time bomb; as soon as one of the patterns is not the same length as rest. Find a solution
// to fix the pattern lengths to a constant value
cursorSongRow := cursorPattern*len(patterns[0]) + cursorRow