tweaks
This commit is contained in:
parent
5b590c23d4
commit
1b0191ef78
2 changed files with 13 additions and 13 deletions
11
yaxis.go
11
yaxis.go
|
|
@ -77,8 +77,8 @@ func (ya YAxis) Render(r Renderer, canvasBox Box, ra Range, axisType YAxisType,
|
|||
v := t.Value
|
||||
ly := ra.Translate(v) + canvasBox.Top
|
||||
|
||||
th := int(fontSize) >> 1
|
||||
ty := ly + th
|
||||
_, pth := r.MeasureText(t.Label)
|
||||
ty := ly + pth>>1
|
||||
|
||||
r.Text(t.Label, tx, ty)
|
||||
|
||||
|
|
@ -97,13 +97,12 @@ func (ya YAxis) Render(r Renderer, canvasBox Box, ra Range, axisType YAxisType,
|
|||
v := t.Value
|
||||
ly := ra.Translate(v) + canvasBox.Top
|
||||
|
||||
ptw, _ := r.MeasureText(t.Label)
|
||||
ptw, pth := r.MeasureText(t.Label)
|
||||
|
||||
tw := ptw
|
||||
th := int(fontSize)
|
||||
|
||||
tx = lx - (int(tw) + (DefaultYAxisMargin >> 1))
|
||||
ty := ly + th>>1
|
||||
tx = lx - (tw + DefaultYAxisMargin)
|
||||
ty := ly + pth>>1
|
||||
|
||||
r.Text(t.Label, tx, ty)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue