2018-02-28 02:17:26 +00:00
|
|
|
package ui
|
|
|
|
|
|
|
|
import (
|
2020-11-30 22:07:03 +00:00
|
|
|
"github.com/gdamore/tcell/v2"
|
2018-02-28 02:17:26 +00: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 07:58:00 +00:00
|
|
|
ctx.SetCell(x, y, rune(f), tcell.StyleDefault)
|
2018-02-28 02:17:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f Fill) OnInvalidate(callback func(d Drawable)) {
|
|
|
|
// no-op
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f Fill) Invalidate() {
|
|
|
|
// no-op
|
|
|
|
}
|