From b5b2d37e875cf765e04ba2a312a8b1efdc6d5d03 Mon Sep 17 00:00:00 2001 From: vicanso Date: Mon, 11 Jul 2022 20:44:28 +0800 Subject: [PATCH] fix: fix axis boundary gap, #13 --- painter.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/painter.go b/painter.go index 0771288..1a954e2 100644 --- a/painter.go +++ b/painter.go @@ -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