Revert "allow explicit height for Table."

This reverts commit 85f8d4f4b7.
This commit is contained in:
Christopher Jeffrey 2015-04-04 03:04:11 -07:00
parent 85f8d4f4b7
commit 15d09e7ce1

View File

@ -7146,7 +7146,7 @@ function Table(options) {
// Regular tables do not get custom height (this would
// require extra padding). Maybe add in the future.
// delete options.height;
delete options.height;
Box.call(this, options);
@ -7288,8 +7288,7 @@ Table.prototype.render = function() {
, yl = coords.yl
, rx
, ry
, i
, over;
, i;
var dattr = this.sattr(this.style)
, hattr = this.sattr(this.style.header)
@ -7383,15 +7382,13 @@ Table.prototype.render = function() {
}
// Draw internal borders.
height = this.position.height != null ? this.height : this.rows.length * 2;
for (ry = 1; ry < height; ry++) {
for (ry = 1; ry < self.rows.length * 2; ry++) {
if (!lines[yi + ry]) break;
over = this.position.height != null && ry >= this.rows.length * 2;
rx = 0;
self._maxes.slice(0, -1).forEach(function(max, i) {
rx += max;
if (!lines[yi + ry][xi + rx + 1]) return;
if (ry % 2 !== 0 || over) {
if (ry % 2 !== 0) {
if (self.options.fillCellBorders) {
var lbg = (ry <= 2 ? hattr : cattr) & 0x1ff;
lines[yi + ry][xi + ++rx][0] = (battr & ~0x1ff) | lbg;
@ -7406,7 +7403,7 @@ Table.prototype.render = function() {
rx = 1;
self._maxes.forEach(function(max, i) {
while (max--) {
if (ry % 2 === 0 && !over) {
if (ry % 2 === 0) {
if (!lines[yi + ry]) break;
if (!lines[yi + ry][xi + rx + 1]) break;
if (self.options.fillCellBorders) {
@ -7423,18 +7420,6 @@ Table.prototype.render = function() {
});
}
// Keep drawing if we have a higher height.
rx = 0;
if (over) {
ry = height - 1;
self._maxes.slice(0, -1).forEach(function(max, i) {
rx += max;
if (!lines[yi + ry][xi + rx + 1]) return;
lines[yi + ry][xi + ++rx][0] = battr;
lines[yi + ry][xi + rx][1] = '\u2534'; // '┴'
});
}
return coords;
};