fix(tracker/gioui): text.Shaper should not be a global variable

text.Shaper is not thread safe, which caused crash when adding
multiple VSTI plugins to a DAW project. This change fixes that
crash. Further refactorings need to consider where that text.Shaper
should actually reside.
This commit is contained in:
5684185+vsariola@users.noreply.github.com
2023-10-22 19:10:24 +03:00
parent 3c85f1155c
commit a38a0f4235
15 changed files with 56 additions and 43 deletions

View File

@ -52,7 +52,7 @@ func (p ParameterStyle) Layout(gtx C) D {
layout.Rigid(func(gtx C) D {
return p.ParameterWidget.labelBtn.Layout(gtx, func(gtx C) D {
gtx.Constraints.Min.X = gtx.Dp(unit.Dp(110))
return layout.E.Layout(gtx, Label(p.Parameter.Name, white))
return layout.E.Layout(gtx, Label(p.Parameter.Name, white, p.tracker.TextShaper))
})
}),
layout.Rigid(func(gtx C) D {
@ -154,7 +154,7 @@ func (p ParameterStyle) Layout(gtx C) D {
}),
layout.Rigid(func(gtx C) D {
if p.Parameter.Type != tracker.IDParameter {
return Label(p.Parameter.Hint, white)(gtx)
return Label(p.Parameter.Hint, white, p.tracker.TextShaper)(gtx)
}
return D{}
}),