Skip to content

Commit

Permalink
Merge branch 'hotfix/3.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
LLKennedy committed Jun 27, 2019
2 parents a0b8680 + 5702e05 commit 235066b
Show file tree
Hide file tree
Showing 32 changed files with 1,654 additions and 865 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Several default components are included, see their documentation as well as deta
```
loader, props, err := imagetemplate.New().Load().FromFile("template.json")
// Check props here, set any discovered variables with real values
// Check props here, set any discovered variables with real values.
data, err := loader.Write().ToBMP(props)
err = ioutil.WriteFile("output.bmp", data, os.ModeExclusive)
Expand Down
10 changes: 5 additions & 5 deletions components/barcode/barcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"golang.org/x/tools/godoc/vfs"
)

// Component implements the Component interface for images
// Component implements the Component interface for images.
type Component struct {
/*
NamedPropertiesMap maps user/application variables to properties of the component.
Expand Down Expand Up @@ -66,7 +66,7 @@ type barcodeFormat struct {
} `json:"backgroundColour"`
}

// Write draws a barcode on the canvas
// Write draws a barcode on the canvas.
func (component Component) Write(canvas render.Canvas) (render.Canvas, error) {
if len(component.NamedPropertiesMap) != 0 {
return canvas, fmt.Errorf("cannot draw barcode, not all named properties are set: %v", component.NamedPropertiesMap)
Expand All @@ -80,7 +80,7 @@ func (component Component) Write(canvas render.Canvas) (render.Canvas, error) {
return c, nil
}

// SetNamedProperties processes the named properties and sets them into the barcode properties
// SetNamedProperties processes the named properties and sets them into the barcode properties.
func (component Component) SetNamedProperties(properties render.NamedProperties) (render.Component, error) {
c := component
setFunc := func(name string, value interface{}) error {
Expand Down Expand Up @@ -189,12 +189,12 @@ func (component Component) SetNamedProperties(properties render.NamedProperties)
return c, nil
}

// GetJSONFormat returns the JSON structure of a barcode component
// GetJSONFormat returns the JSON structure of a barcode component.
func (component Component) GetJSONFormat() interface{} {
return &barcodeFormat{}
}

// VerifyAndSetJSONData processes the data parsed from JSON and uses it to set barcode properties and fill the named properties map
// VerifyAndSetJSONData processes the data parsed from JSON and uses it to set barcode properties and fill the named properties map.
func (component Component) VerifyAndSetJSONData(data interface{}) (render.Component, render.NamedProperties, error) {
c := component
props := make(render.NamedProperties)
Expand Down
10 changes: 5 additions & 5 deletions components/circle/circle.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"golang.org/x/tools/godoc/vfs"
)

// Component implements the Component interface for circles
// Component implements the Component interface for circles.
type Component struct {
/*
NamedPropertiesMap maps user/application variables to properties of the component.
Expand Down Expand Up @@ -48,15 +48,15 @@ type colourFormat struct {
Alpha string `json:"A"`
}

// Write draws a circle on the canvas
// Write draws a circle on the canvas.
func (component Component) Write(canvas render.Canvas) (render.Canvas, error) {
if len(component.NamedPropertiesMap) != 0 {
return canvas, fmt.Errorf("cannot draw circle, not all named properties are set: %v", component.NamedPropertiesMap)
}
return canvas.Circle(component.Centre, component.Radius, component.Colour)
}

// SetNamedProperties processes the named properties and sets them into the circle properties
// SetNamedProperties processes the named properties and sets them into the circle properties.
func (component Component) SetNamedProperties(properties render.NamedProperties) (render.Component, error) {
c := component
setFunc := func(name string, value interface{}) error {
Expand Down Expand Up @@ -107,12 +107,12 @@ func (component Component) SetNamedProperties(properties render.NamedProperties)
return c, nil
}

// GetJSONFormat returns the JSON structure of a circle component
// GetJSONFormat returns the JSON structure of a circle component.
func (component Component) GetJSONFormat() interface{} {
return &circleFormat{}
}

// VerifyAndSetJSONData processes the data parsed from JSON and uses it to set circle properties and fill the named properties map
// VerifyAndSetJSONData processes the data parsed from JSON and uses it to set circle properties and fill the named properties map.
func (component Component) VerifyAndSetJSONData(data interface{}) (render.Component, render.NamedProperties, error) {
c := component
props := make(render.NamedProperties)
Expand Down

0 comments on commit 235066b

Please sign in to comment.