adding back default font color for annotations.

This commit is contained in:
Will Charczuk 2016-07-30 09:52:18 -07:00
parent 1af266dc7e
commit bf962d256a
2 changed files with 5 additions and 2 deletions

View file

@ -27,6 +27,7 @@ func (as AnnotationSeries) GetYAxis() yAxisType {
func (as AnnotationSeries) annotationStyleDefaults(defaults Style) Style { func (as AnnotationSeries) annotationStyleDefaults(defaults Style) Style {
return Style{ return Style{
FontColor: DefaultTextColor,
Font: defaults.Font, Font: defaults.Font,
FillColor: DefaultAnnotationFillColor, FillColor: DefaultAnnotationFillColor,
FontSize: DefaultAnnotationFontSize, FontSize: DefaultAnnotationFontSize,

View file

@ -165,12 +165,13 @@ func (d draw) MeasureAnnotation(r Renderer, canvasBox Box, style Style, lx, ly i
// Annotation draws an anotation with a renderer. // Annotation draws an anotation with a renderer.
func (d draw) Annotation(r Renderer, canvasBox Box, style Style, lx, ly int, label string) { func (d draw) Annotation(r Renderer, canvasBox Box, style Style, lx, ly int, label string) {
style.WriteToRenderer(r) style.GetTextOptions().WriteToRenderer(r)
textBox := r.MeasureText(label) textBox := r.MeasureText(label)
textWidth := textBox.Width() textWidth := textBox.Width()
halfTextHeight := textBox.Height() >> 1 halfTextHeight := textBox.Height() >> 1
style.GetFillAndStrokeOptions().WriteToRenderer(r)
pt := style.Padding.GetTop(DefaultAnnotationPadding.Top) pt := style.Padding.GetTop(DefaultAnnotationPadding.Top)
pl := style.Padding.GetLeft(DefaultAnnotationPadding.Left) pl := style.Padding.GetLeft(DefaultAnnotationPadding.Left)
pr := style.Padding.GetRight(DefaultAnnotationPadding.Right) pr := style.Padding.GetRight(DefaultAnnotationPadding.Right)
@ -200,6 +201,7 @@ func (d draw) Annotation(r Renderer, canvasBox Box, style Style, lx, ly int, lab
r.Close() r.Close()
r.FillStroke() r.FillStroke()
style.GetTextOptions().WriteToRenderer(r)
r.Text(label, textX, textY) r.Text(label, textX, textY)
} }