Skip to content

Commit 77748a6

Browse files
authored
Merge pull request #325 from gucio321/tstr
fontAtlasProcessor: modify tStr*; add tStrSlice
2 parents dae68d0 + 7a1710c commit 77748a6

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

FontAtlasProsessor.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,14 @@ func tStrPtr(str *string) *string {
175175
return str
176176
}
177177

178+
func tStrSlice(str []string) []string {
179+
for _, s := range str {
180+
tStr(s)
181+
}
182+
183+
return str
184+
}
185+
178186
// Rebuild font atlas when necessary.
179187
func rebuildFontAtlas() {
180188
if !shouldRebuildFontAtlas {

Plot.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@ func (p *PlotPieChartWidget) Angle0(a float64) *PlotPieChartWidget {
347347
}
348348

349349
func (p *PlotPieChartWidget) Plot() {
350-
for _, l := range p.labels {
351-
tStr(l)
352-
}
353-
imgui.ImPlotPieChart(p.labels, p.values, p.x, p.y, p.radius, p.normalize, p.labelFormat, p.angle0)
350+
imgui.ImPlotPieChart(tStrSlice(p.labels), p.values, p.x, p.y, p.radius, p.normalize, p.labelFormat, p.angle0)
354351
}
355352

356353
type PlotScatterWidget struct {

Widgets.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,14 +573,10 @@ type ComboWidget struct {
573573
}
574574

575575
func Combo(label, previewValue string, items []string, selected *int32) *ComboWidget {
576-
for _, item := range items {
577-
tStr(item)
578-
}
579-
580576
return &ComboWidget{
581577
label: tStr(label),
582578
previewValue: tStr(previewValue),
583-
items: items,
579+
items: tStrSlice(items),
584580
selected: selected,
585581
flags: 0,
586582
width: 0,

0 commit comments

Comments
 (0)