This commit is contained in:
Will Charczuk 2016-07-11 18:48:51 -07:00
parent 01983f4e86
commit 9a5138b21d
17 changed files with 477 additions and 308 deletions

View file

@ -13,12 +13,14 @@ type Style struct {
Show bool
Padding Box
StrokeWidth float64
StrokeColor drawing.Color
FillColor drawing.Color
FontSize float64
FontColor drawing.Color
Font *truetype.Font
StrokeWidth float64
StrokeColor drawing.Color
StrokeDashArray []float64
FillColor drawing.Color
FontSize float64
FontColor drawing.Color
Font *truetype.Font
}
// IsZero returns if the object is set or not.
@ -59,6 +61,17 @@ func (s Style) GetStrokeWidth(defaults ...float64) float64 {
return s.StrokeWidth
}
// GetStrokeDashArray returns the stroke dash array.
func (s Style) GetStrokeDashArray(defaults ...[]float64) []float64 {
if len(s.StrokeDashArray) == 0 {
if len(defaults) > 0 {
return defaults[0]
}
return nil
}
return s.StrokeDashArray
}
// GetFontSize gets the font size.
func (s Style) GetFontSize(defaults ...float64) float64 {
if s.FontSize == 0 {