aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui/fill.go
blob: eedb481e177dcbb0a15e6a3e4b1a833e2769bc35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package ui

import "git.sr.ht/~rockorager/vaxis"

type Fill struct {
	Rune  rune
	Style vaxis.Style
}

func NewFill(f rune, s vaxis.Style) Fill {
	return Fill{f, s}
}

func (f Fill) Draw(ctx *Context) {
	for x := 0; x < ctx.Width(); x += 1 {
		for y := 0; y < ctx.Height(); y += 1 {
			ctx.SetCell(x, y, f.Rune, f.Style)
		}
	}
}

func (f Fill) Invalidate() {
	// no-op
}