refactor: adjust text render of axis

This commit is contained in:
vicanso 2022-07-06 20:44:52 +08:00
parent eef3a2f97b
commit 0a3ac7096a
2 changed files with 9 additions and 2 deletions

View file

@ -653,8 +653,9 @@ func (p *Painter) MultiText(opt MultiTextOption) *Painter {
} else {
values = autoDivide(width, count)
}
showIndex := opt.Unit / 2
for index, text := range opt.TextList {
if opt.Unit != 0 && index%opt.Unit != 0 {
if opt.Unit != 0 && index%opt.Unit != showIndex {
continue
}
box := p.MeasureText(text)