fix: fix axis boundary gap, #13
This commit is contained in:
parent
805f4381a3
commit
b5b2d37e87
1 changed files with 3 additions and 1 deletions
|
|
@ -637,12 +637,15 @@ func (p *Painter) MultiText(opt MultiTextOption) *Painter {
|
|||
}
|
||||
count := len(opt.TextList)
|
||||
positionCenter := true
|
||||
showIndex := opt.Unit / 2
|
||||
if containsString([]string{
|
||||
PositionLeft,
|
||||
PositionTop,
|
||||
}, opt.Position) {
|
||||
positionCenter = false
|
||||
count--
|
||||
// 非居中
|
||||
showIndex = 0
|
||||
}
|
||||
width := p.Width()
|
||||
height := p.Height()
|
||||
|
|
@ -653,7 +656,6 @@ 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 != showIndex {
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue