aboutsummaryrefslogblamecommitdiffstats
path: root/lib/ui/fill.go
blob: 13ad286d26fd1ff33c5889d5691833f8331d73d3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


          
                                     

 



                         
 

                                          




                                                      
                                                          










                                                       
package ui

import (
	"github.com/gdamore/tcell/v2"
)

type Fill struct {
	Rune  rune
	Style tcell.Style
}

func NewFill(f rune, s tcell.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) OnInvalidate(callback func(d Drawable)) {
	// no-op
}

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