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