From a42d0727df41f5f788ae015c9472a5675bf27774 Mon Sep 17 00:00:00 2001 From: vicanso Date: Tue, 15 Nov 2022 20:09:29 +0800 Subject: [PATCH] feat: support text rotation --- painter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/painter.go b/painter.go index 97ad205..6743b37 100644 --- a/painter.go +++ b/painter.go @@ -558,6 +558,12 @@ func (p *Painter) Text(body string, x, y int) *Painter { 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 { style := p.style textWarp := style.TextWrap