added Fill method

This commit is contained in:
Timon Ringwald 2020-10-01 14:14:43 +02:00
parent f72c9e7aa3
commit 011bf8e616

View File

@ -10,3 +10,12 @@ func (b *Buffer) WriteString(str string, x, y int) {
b.Set(x+dx, y, r) b.Set(x+dx, y, r)
} }
} }
// Fill fills the whole buffer with c
func (b *Buffer) Fill(c rune) {
for _, col := range b.data {
for ri := range col {
col[ri] = c
}
}
}