fix: fix test for text roration
This commit is contained in:
parent
d5533447f5
commit
830d4bdd21
1 changed files with 8 additions and 3 deletions
11
painter.go
11
painter.go
|
|
@ -685,13 +685,16 @@ func (p *Painter) MultiText(opt MultiTextOption) *Painter {
|
||||||
} else {
|
} else {
|
||||||
values = autoDivide(width, count)
|
values = autoDivide(width, count)
|
||||||
}
|
}
|
||||||
|
isTextRotation := opt.TextRotation != 0
|
||||||
offset := opt.Offset
|
offset := opt.Offset
|
||||||
for index, text := range opt.TextList {
|
for index, text := range opt.TextList {
|
||||||
if opt.Unit != 0 && index%opt.Unit != showIndex {
|
if opt.Unit != 0 && index%opt.Unit != showIndex {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p.ClearTextRotation()
|
if isTextRotation {
|
||||||
p.SetTextRotation(opt.TextRotation)
|
p.ClearTextRotation()
|
||||||
|
p.SetTextRotation(opt.TextRotation)
|
||||||
|
}
|
||||||
box := p.MeasureText(text)
|
box := p.MeasureText(text)
|
||||||
start := values[index]
|
start := values[index]
|
||||||
if positionCenter {
|
if positionCenter {
|
||||||
|
|
@ -716,7 +719,9 @@ func (p *Painter) MultiText(opt MultiTextOption) *Painter {
|
||||||
y += offset.Top
|
y += offset.Top
|
||||||
p.Text(text, x, y)
|
p.Text(text, x, y)
|
||||||
}
|
}
|
||||||
p.ClearTextRotation()
|
if isTextRotation {
|
||||||
|
p.ClearTextRotation()
|
||||||
|
}
|
||||||
return p
|
return p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue