feat: support axis render
This commit is contained in:
parent
4cf494088e
commit
b394e1b49f
5 changed files with 344 additions and 39 deletions
15
painter.go
15
painter.go
|
|
@ -417,6 +417,21 @@ func (p *Painter) MeasureText(text string) Box {
|
|||
return p.render.MeasureText(text)
|
||||
}
|
||||
|
||||
func (p *Painter) MeasureTextMaxWidthHeight(textList []string) (int, int) {
|
||||
maxWidth := 0
|
||||
maxHeight := 0
|
||||
for _, text := range textList {
|
||||
box := p.MeasureText(text)
|
||||
if maxWidth < box.Width() {
|
||||
maxWidth = box.Width()
|
||||
}
|
||||
if maxHeight < box.Height() {
|
||||
maxHeight = box.Height()
|
||||
}
|
||||
}
|
||||
return maxWidth, maxHeight
|
||||
}
|
||||
|
||||
func (p *Painter) LineStroke(points []Point) *Painter {
|
||||
for index, point := range points {
|
||||
x := point.X
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue