mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-11 11:34:20 +00:00
have padding maintain background color.
This commit is contained in:
parent
c61d4e6b80
commit
c8c0d1f269
@ -2171,6 +2171,35 @@ outer:
|
|||||||
xi_ -= this.padding, xl += this.padding;
|
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) {
|
if (this.border) {
|
||||||
yi = yi_;
|
yi = yi_;
|
||||||
for (xi = xi_; xi < xl; xi++) {
|
for (xi = xi_; xi < xl; xi++) {
|
||||||
|
@ -11,9 +11,9 @@ blessed.box({
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
top: 'center',
|
top: 'center',
|
||||||
width: 20,
|
width: 22,
|
||||||
height: 8,
|
height: 10,
|
||||||
padding: 1
|
padding: 2
|
||||||
});
|
});
|
||||||
|
|
||||||
screen.key('q', function() {
|
screen.key('q', function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user