From 011bf8e6164c0ce4913bffe419fa7aa363b1bc84 Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Thu, 1 Oct 2020 14:14:43 +0200 Subject: [PATCH] added Fill method --- write_string.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/write_string.go b/write_string.go index 81858c7..aa046b0 100644 --- a/write_string.go +++ b/write_string.go @@ -10,3 +10,12 @@ func (b *Buffer) WriteString(str string, x, y int) { 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 + } + } +}