Always fill Box background

This resolves rendering issues with TextViews which have their background
color set to ColorDefault.
This commit is contained in:
Trevor Slocum 2020-01-28 07:02:45 -08:00
parent e877362f62
commit 339db80f66
1 changed files with 3 additions and 5 deletions

8
box.go
View File

@ -299,11 +299,9 @@ func (b *Box) Draw(screen tcell.Screen) {
// Fill background.
background := def.Background(b.backgroundColor)
if b.backgroundColor != tcell.ColorDefault {
for y := b.y; y < b.y+b.height; y++ {
for x := b.x; x < b.x+b.width; x++ {
screen.SetContent(x, y, ' ', nil, background)
}
for y := b.y; y < b.y+b.height; y++ {
for x := b.x; x < b.x+b.width; x++ {
screen.SetContent(x, y, ' ', nil, background)
}
}