feat: support text rotation

This commit is contained in:
vicanso 2022-11-15 20:09:29 +08:00
parent 7e1f003be8
commit a42d0727df

View file

@ -558,6 +558,12 @@ func (p *Painter) Text(body string, x, y int) *Painter {
return p return p
} }
func (p *Painter) TextRotation(body string, x, y int, radians float64) {
p.render.SetTextRotation(radians)
p.render.Text(body, x, y)
p.render.ClearTextRotation()
}
func (p *Painter) TextFit(body string, x, y, width int, textAligns ...string) chart.Box { func (p *Painter) TextFit(body string, x, y, width int, textAligns ...string) chart.Box {
style := p.style style := p.style
textWarp := style.TextWrap textWarp := style.TextWrap