swallow invalid point error in SetRune

This commit is contained in:
Jesse Duffield 2019-09-08 11:25:10 +10:00
parent ad0cd60f29
commit 092b2290ee

3
gui.go
View File

@ -141,7 +141,8 @@ func (g *Gui) Size() (x, y int) {
// the given colors.
func (g *Gui) SetRune(x, y int, ch rune, fgColor, bgColor Attribute) error {
if x < 0 || y < 0 || x >= g.maxX || y >= g.maxY {
return errors.New("invalid point")
// swallowing error because it's not that big of a deal
return nil
}
termbox.SetCell(x, y, ch, termbox.Attribute(fgColor), termbox.Attribute(bgColor))
return nil