From c574b27d343e5b6b11c2de78df947c0449455bc2 Mon Sep 17 00:00:00 2001 From: vsariola <5684185+vsariola@users.noreply.github.com> Date: Fri, 5 Feb 2021 22:28:04 +0200 Subject: [PATCH] fix(tracker): when changing unit type, use tracker.SetUnit --- tracker/uniteditor.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tracker/uniteditor.go b/tracker/uniteditor.go index 6f8b600..649ac95 100644 --- a/tracker/uniteditor.go +++ b/tracker/uniteditor.go @@ -109,8 +109,7 @@ func (t *Tracker) layoutUnitTypeChooser() layout.Widget { paint.FillShape(gtx.Ops, unitSurfaceColor, clip.Rect{Max: image.Pt(gtx.Constraints.Max.X, gtx.Constraints.Max.Y)}.Op()) listElem := func(gtx C, i int) D { for t.ChooseUnitTypeBtns[i].Clicked() { - u := defaultUnits[allUnits[i]] - t.song.Patch.Instruments[t.CurrentInstrument].Units[t.CurrentUnit] = (&u).Copy() + t.SetUnit(allUnits[i]) } labelStyle := LabelStyle{Text: allUnits[i], ShadeColor: black, Color: white, Font: labelDefaultFont, FontSize: unit.Sp(12)} bg := func(gtx C) D {