Skip to content

Commit

Permalink
cops: Display.Set: support nil colors
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorbin committed Dec 18, 2017
1 parent 80e26fb commit 6559a46
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/cops/display/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ func (d *Display) Clear(r image.Rectangle) {
// the given position.
func (d *Display) Set(x, y int, t string, f, b color.Color) {
d.Text.Set(x, y, t)
d.Foreground.Set(x, y, f)
d.Background.Set(x, y, b)
if f != nil {
d.Foreground.Set(x, y, f)
}
if b != nil {
d.Background.Set(x, y, b)
}
}

// SetRGBA is a faster Set.
Expand Down

0 comments on commit 6559a46

Please sign in to comment.