2018-02-28 03:17:26 +01:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
2018-06-01 09:58:00 +02:00
|
|
|
"github.com/gdamore/tcell"
|
2018-02-28 03:17:26 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type Fill rune
|
|
|
|
|
|
|
|
func NewFill(f rune) Fill {
|
|
|
|
return Fill(f)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f Fill) Draw(ctx *Context) {
|
|
|
|
for x := 0; x < ctx.Width(); x += 1 {
|
|
|
|
for y := 0; y < ctx.Height(); y += 1 {
|
2018-06-01 09:58:00 +02:00
|
|
|
ctx.SetCell(x, y, rune(f), tcell.StyleDefault)
|
2018-02-28 03:17:26 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f Fill) OnInvalidate(callback func(d Drawable)) {
|
|
|
|
// no-op
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f Fill) Invalidate() {
|
|
|
|
// no-op
|
|
|
|
}
|