test: add test for axis

This commit is contained in:
vicanso 2022-06-18 10:38:46 +08:00
parent 635e440e85
commit d3c6649cd9
12 changed files with 145 additions and 40 deletions

View file

@ -81,7 +81,10 @@ func (a *axisPainter) Render() (Box, error) {
opt := a.opt
top := a.p
theme := opt.Theme
if opt.Show != nil && !*opt.Show {
if theme == nil {
theme = top.theme
}
if isFalse(opt.Show) {
return BoxZero, nil
}
@ -121,7 +124,7 @@ func (a *axisPainter) Render() (Box, error) {
tickCount := dataCount
boundaryGap := true
if opt.BoundaryGap != nil && !*opt.BoundaryGap {
if isFalse(opt.BoundaryGap) {
boundaryGap = false
}
isVertical := opt.Position == PositionLeft ||