mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -04:00
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:
parent
3c85f1155c
commit
a38a0f4235
@ -11,6 +11,7 @@ import (
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/op"
|
||||
"gioui.org/text"
|
||||
"gioui.org/unit"
|
||||
"gioui.org/widget"
|
||||
"gioui.org/widget/material"
|
||||
@ -55,6 +56,8 @@ type Tracker struct {
|
||||
TrackEditor *TrackEditor
|
||||
Explorer *explorer.Explorer
|
||||
|
||||
TextShaper *text.Shaper
|
||||
|
||||
lastAvgVolume tracker.Volume
|
||||
lastPeakVolume tracker.Volume
|
||||
|
||||
@ -153,6 +156,8 @@ func NewTracker(model *tracker.Model, synther sointu.Synther) *Tracker {
|
||||
marshalRecoveryChannel: make(chan (chan []byte)),
|
||||
unmarshalRecoveryChannel: make(chan []byte),
|
||||
}
|
||||
t.TextShaper = text.NewShaper(text.WithCollection(fontCollection))
|
||||
t.Alert.shaper = t.TextShaper
|
||||
t.Theme.Palette.Fg = primaryColor
|
||||
t.Theme.Palette.ContrastFg = black
|
||||
t.TrackEditor.Focus()
|
||||
|
Reference in New Issue
Block a user