fix darken.

This commit is contained in:
Christopher Jeffrey 2015-04-06 20:47:08 -07:00
parent 5958b55bd0
commit 49e4ec976b
1 changed files with 14 additions and 10 deletions

View File

@ -4175,7 +4175,7 @@ Screen.prototype._dockBorders = function() {
for (x = 0; x < this.width; x++) {
ch = lines[y][x][1];
if (angles[ch]) {
lines[y][x][1] = getAngle(x, y, lines);
lines[y][x][1] = getAngle(lines, x, y);
}
}
}
@ -8627,7 +8627,7 @@ Object.keys(angleTable).forEach(function(key) {
delete angleTable[key];
});
function getAngle(x, y, lines) {
function getAngle(lines, x, y) {
var angle = 0
, attr = lines[y][x][0]
, ch = lines[y][x][1];
@ -8663,10 +8663,12 @@ function darken(attr) {
bg -= 8;
} else {
var name = colors.ncolors[bg];
for (var i = 0; i < colors.ncolors.length; i++) {
if (name === colors.ncolors[i] && bg !== i) {
bg = i;
break;
if (name) {
for (var i = 0; i < colors.ncolors.length; i++) {
if (name === colors.ncolors[i] && bg !== i) {
bg = i;
break;
}
}
}
}
@ -8680,10 +8682,12 @@ function darken(attr) {
fg -= 8;
} else {
var name = colors.ncolors[fg];
for (var i = 0; i < colors.ncolors.length; i++) {
if (name === colors.ncolors[i] && fg !== i) {
fg = i;
break;
if (name) {
for (var i = 0; i < colors.ncolors.length; i++) {
if (name === colors.ncolors[i] && fg !== i) {
fg = i;
break;
}
}
}
}