Skip to content

Commit

Permalink
FontAtlasProcessor: add tStrSlice
Browse files Browse the repository at this point in the history
  • Loading branch information
gucio321 committed Sep 19, 2021
1 parent be66319 commit 27c97a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 8 additions & 0 deletions FontAtlasProsessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ func tStrPtr(str *string) *string {
return str
}

func tStrSlice(str []string) []string {
for _, s := range str {
tStr(s)
}

return str
}

// Rebuild font atlas when necessary.
func rebuildFontAtlas() {
if !shouldRebuildFontAtlas {
Expand Down
5 changes: 1 addition & 4 deletions Plot.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,7 @@ func (p *PlotPieChartWidget) Angle0(a float64) *PlotPieChartWidget {
}

func (p *PlotPieChartWidget) Plot() {
for _, l := range p.labels {
tStr(l)
}
imgui.ImPlotPieChart(p.labels, p.values, p.x, p.y, p.radius, p.normalize, p.labelFormat, p.angle0)
imgui.ImPlotPieChart(tStrSlice(p.labels), p.values, p.x, p.y, p.radius, p.normalize, p.labelFormat, p.angle0)
}

type PlotScatterWidget struct {
Expand Down
6 changes: 1 addition & 5 deletions Widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,10 @@ type ComboWidget struct {
}

func Combo(label, previewValue string, items []string, selected *int32) *ComboWidget {
for _, item := range items {
tStr(item)
}

return &ComboWidget{
label: tStr(label),
previewValue: tStr(previewValue),
items: items,
items: tStrSlice(items),
selected: selected,
flags: 0,
width: 0,
Expand Down

0 comments on commit 27c97a5

Please sign in to comment.