fix valign option.

This commit is contained in:
Christopher Jeffrey 2015-04-02 05:09:20 -07:00
parent 2640838f33
commit b9a94f63ce
2 changed files with 28 additions and 1 deletions

View File

@ -3741,7 +3741,7 @@ Element.prototype.render = function() {
} else if (this.valign === 'bottom') {
visible -= this._clines.length;
}
yi += visible;
ci -= visible * (xl - xi);
}
}

27
test/widget-valign.js Normal file
View File

@ -0,0 +1,27 @@
var blessed = require('../')
, screen;
screen = blessed.screen({
dump: __dirname + '/logs/valign.log',
smartCSR: true,
autoPadding: false
});
var box = blessed.box({
parent: screen,
top: 'center',
left: 'center',
width: '50%',
height: 5,
align: 'center',
valign: 'middle',
// valign: 'bottom',
content: 'Foobar.',
border: 'line'
});
screen.key('q', function() {
return process.exit(0);
});
screen.render();