add setdontclear for cases where padding and borders arent cleared with bg color

This commit is contained in:
digitallyserviced 2023-07-03 16:21:05 -04:00
parent 6cc0565bab
commit bcc76efaa5
1 changed files with 7 additions and 0 deletions

7
box.go
View File

@ -82,6 +82,13 @@ func NewBox() *Box {
return b return b
} }
// SetDontClear sets whether the draw function
// clears the bg with defined color
func (b *Box) SetDontClear(dontClear bool) *Box {
b.dontClear = dontClear
return b
}
// SetBorderPadding sets the size of the borders around the box content. // SetBorderPadding sets the size of the borders around the box content.
func (b *Box) SetBorderPadding(top, bottom, left, right int) *Box { func (b *Box) SetBorderPadding(top, bottom, left, right int) *Box {
b.paddingTop, b.paddingBottom, b.paddingLeft, b.paddingRight = top, bottom, left, right b.paddingTop, b.paddingBottom, b.paddingLeft, b.paddingRight = top, bottom, left, right