This commit is contained in:
Will Charczuk 2016-07-11 00:12:14 -07:00
parent 5b590c23d4
commit 1b0191ef78
2 changed files with 13 additions and 13 deletions

View file

@ -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)