diff --git a/lib/widget.js b/lib/widget.js index 8a6a78a..a2bf6a6 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -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; + } } } }