have padding maintain background color.

This commit is contained in:
Christopher Jeffrey 2013-07-16 20:07:00 -05:00
parent c61d4e6b80
commit c8c0d1f269
2 changed files with 32 additions and 3 deletions

View File

@ -2171,6 +2171,35 @@ outer:
xi_ -= this.padding, xl += this.padding;
}
if (this.padding) {
// Set padding to green for debugging:
// dattr = (dattr & ~0x1ff) | colors.convert('green');
// top
this.screen.fillRegion(dattr, ' ',
xi_ + (this.border ? 1 : 0),
xl - (this.border ? 1 : 0),
yi_ + (this.border ? 1 : 0),
yi_ + 0 + (this.border ? 1 : 0) + this.padding);
// bottom
this.screen.fillRegion(dattr, ' ',
xi_ + (this.border ? 1 : 0),
xl - (this.border ? 1 : 0),
yl - 0 - (this.border ? 1 : 0) - this.padding,
yl - (this.border ? 1 : 0));
// left
this.screen.fillRegion(dattr, ' ',
xi_ + (this.border ? 1 : 0),
xi_ + 0 + (this.border ? 1 : 0) + this.padding,
yi_ + (this.border ? 1 : 0),
yl - (this.border ? 1 : 0));
// right
this.screen.fillRegion(dattr, ' ',
xl - 0 - (this.border ? 1 : 0) - this.padding,
xl - (this.border ? 1 : 0),
yi_ + (this.border ? 1 : 0),
yl - (this.border ? 1 : 0));
}
if (this.border) {
yi = yi_;
for (xi = xi_; xi < xl; xi++) {

View File

@ -11,9 +11,9 @@ blessed.box({
align: 'center',
left: 'center',
top: 'center',
width: 20,
height: 8,
padding: 1
width: 22,
height: 10,
padding: 2
});
screen.key('q', function() {