refactor: reset
This commit is contained in:
parent
7e80e9a848
commit
c363d1d5e3
50 changed files with 55 additions and 10282 deletions
10
util_test.go
10
util_test.go
|
|
@ -80,13 +80,15 @@ func TestGetRadius(t *testing.T) {
|
|||
|
||||
func TestMeasureTextMaxWidthHeight(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
r, err := chart.SVG(400, 300)
|
||||
p, err := NewPainter(PainterOptions{
|
||||
Width: 400,
|
||||
Height: 300,
|
||||
})
|
||||
assert.Nil(err)
|
||||
style := chart.Style{
|
||||
FontSize: 10,
|
||||
}
|
||||
style.Font, _ = chart.GetDefaultFont()
|
||||
style.WriteToRenderer(r)
|
||||
p.SetStyle(style)
|
||||
|
||||
maxWidth, maxHeight := measureTextMaxWidthHeight([]string{
|
||||
"Mon",
|
||||
|
|
@ -96,7 +98,7 @@ func TestMeasureTextMaxWidthHeight(t *testing.T) {
|
|||
"Fri",
|
||||
"Sat",
|
||||
"Sun",
|
||||
}, r)
|
||||
}, p)
|
||||
assert.Equal(26, maxWidth)
|
||||
assert.Equal(12, maxHeight)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue