Skip to content
This repository has been archived by the owner on Aug 23, 2024. It is now read-only.

Commit

Permalink
adding back default font color for annotations.
Browse files Browse the repository at this point in the history
  • Loading branch information
wcharczuk committed Jul 30, 2016
1 parent 1af266d commit bf962d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions annotation_series.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func (as AnnotationSeries) GetYAxis() yAxisType {

func (as AnnotationSeries) annotationStyleDefaults(defaults Style) Style {
return Style{
FontColor: DefaultTextColor,
Font: defaults.Font,
FillColor: DefaultAnnotationFillColor,
FontSize: DefaultAnnotationFontSize,
Expand Down
6 changes: 4 additions & 2 deletions draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ func (d draw) MeasureAnnotation(r Renderer, canvasBox Box, style Style, lx, ly i

// Annotation draws an anotation with a renderer.
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)
textWidth := textBox.Width()
halfTextHeight := textBox.Height() >> 1

style.GetFillAndStrokeOptions().WriteToRenderer(r)

pt := style.Padding.GetTop(DefaultAnnotationPadding.Top)
pl := style.Padding.GetLeft(DefaultAnnotationPadding.Left)
pr := style.Padding.GetRight(DefaultAnnotationPadding.Right)
Expand Down Expand Up @@ -200,6 +201,7 @@ func (d draw) Annotation(r Renderer, canvasBox Box, style Style, lx, ly int, lab
r.Close()
r.FillStroke()

style.GetTextOptions().WriteToRenderer(r)
r.Text(label, textX, textY)
}

Expand Down

0 comments on commit bf962d2

Please sign in to comment.