Debian Codegraph @

lib/ui/fill.go

raw
1 package ui
2
3 import "go.rockorager.dev/vaxis"
4
5 type Fill struct {
6 Rune rune
7 Style vaxis.Style
8 }
9
10 func NewFill(f rune, s vaxis.Style) Fill {
11 return Fill{f, s}
12 }
13
14 func (f Fill) Draw(ctx *Context) {
15 for x := 0; x < ctx.Width(); x += 1 {
16 for y := 0; y < ctx.Height(); y += 1 {
17 ctx.SetCell(x, y, f.Rune, f.Style)
18 }
19 }
20 }
21
22 func (f Fill) Invalidate() {
23 // no-op
24 }