fix: set table cell border lines to dirty before rendering.

This commit is contained in:
Christopher Jeffrey 2015-07-28 02:43:29 -07:00
parent 141c5a6eab
commit 852d780990
2 changed files with 9 additions and 0 deletions

View File

@ -200,6 +200,7 @@ ListTable.prototype.render = function() {
if (!self.border.top) {
lines[yi + ry][xi + rx][1] = '\u2502'; // '│'
}
lines[yi + ry].dirty = true;
} else if (ry === height) {
// bottom
lines[yi + ry][xi + ++rx][0] = battr;
@ -208,6 +209,7 @@ ListTable.prototype.render = function() {
if (!self.border.bottom) {
lines[yi + ry][xi + rx][1] = '\u2502'; // '│'
}
lines[yi + ry].dirty = true;
} else {
// middle
++rx;
@ -230,6 +232,7 @@ ListTable.prototype.render = function() {
lines[yi + ry][xi + ++rx][0] = battr;
}
lines[yi + ry][xi + rx][1] = '\u2502'; // '│'
lines[yi + ry].dirty = true;
});
}

View File

@ -198,6 +198,7 @@ Table.prototype.render = function() {
} else {
lines[yi + y][xi + x][0] = cattr;
}
lines[yi + y].dirty = true;
}
}
@ -230,6 +231,7 @@ Table.prototype.render = function() {
lines[yi + ry][xi + 0][1] = '\u2500'; // '─'
}
}
lines[yi + ry].dirty = true;
} else if (i === self._maxes.length - 1) {
if (!lines[yi + ry][xi + rx + 1]) return;
// right side
@ -250,6 +252,7 @@ Table.prototype.render = function() {
lines[yi + ry][xi + rx][1] = '\u2500'; // '─'
}
}
lines[yi + ry].dirty = true;
return;
}
if (!lines[yi + ry][xi + rx + 1]) return;
@ -281,6 +284,7 @@ Table.prototype.render = function() {
lines[yi + ry][xi + rx][1] = '\u253c'; // '┼'
// ++rx;
}
lines[yi + ry].dirty = true;
});
ry += 2;
}
@ -300,6 +304,7 @@ Table.prototype.render = function() {
lines[yi + ry][xi + ++rx][0] = battr;
}
lines[yi + ry][xi + rx][1] = '\u2502'; // '│'
lines[yi + ry].dirty = true;
} else {
rx++;
}
@ -317,6 +322,7 @@ Table.prototype.render = function() {
lines[yi + ry][xi + rx][0] = battr;
}
lines[yi + ry][xi + rx][1] = '\u2500'; // '─'
lines[yi + ry].dirty = true;
}
rx++;
}