add ignoreDockContrast option.
This commit is contained in:
parent
0ea19cacad
commit
b5341b8b81
|
@ -276,6 +276,9 @@ The screen on which every other node renders.
|
|||
│ box1 │ box2 │
|
||||
└─────────┴─────────┘
|
||||
```
|
||||
- __ignoreDockContrast__ - normally, dockable borders will not dock if the
|
||||
colors or attributes are different. this option will allow them to dock
|
||||
regardless. it may produce some odd looking multi-colored borders though.
|
||||
- __fullUnicode__ - allow for rendering of East Asian double-width characters,
|
||||
utf-16 surrogate pairs, and unicode combining characters. this allows you to
|
||||
display text above the basic multilingual plane. this is behind an option
|
||||
|
|
|
@ -14,7 +14,10 @@ var blessed = require('blessed')
|
|||
|
||||
screen = blessed.screen({
|
||||
smartCSR: true,
|
||||
log: process.env.HOME + '/blessed-terminal.log'
|
||||
log: process.env.HOME + '/blessed-terminal.log',
|
||||
fullUnicode: true,
|
||||
dockBorders: true,
|
||||
ignoreDockContrast: true
|
||||
});
|
||||
|
||||
var left = blessed.terminal({
|
||||
|
@ -23,10 +26,11 @@ var left = blessed.terminal({
|
|||
cursorBlink: true,
|
||||
screenKeys: false,
|
||||
left: 0,
|
||||
top: 2,
|
||||
bottom: 2,
|
||||
width: '40%',
|
||||
border: 'line',
|
||||
top: 0,
|
||||
width: '50%',
|
||||
border: {
|
||||
type: 'line',
|
||||
},
|
||||
style: {
|
||||
fg: 'default',
|
||||
bg: 'default',
|
||||
|
@ -47,11 +51,12 @@ var right = blessed.terminal({
|
|||
cursor: 'block',
|
||||
cursorBlink: true,
|
||||
screenKeys: false,
|
||||
right: 2,
|
||||
top: 2,
|
||||
bottom: 2,
|
||||
width: '40%',
|
||||
border: 'line',
|
||||
left: '50%-1',
|
||||
top: 0,
|
||||
width: '50%+1',
|
||||
border: {
|
||||
type: 'line',
|
||||
},
|
||||
style: {
|
||||
fg: 'red',
|
||||
bg: 'black',
|
||||
|
|
|
@ -1086,22 +1086,30 @@ Screen.prototype._getAngle = function(lines, x, y) {
|
|||
, ch = lines[y][x][1];
|
||||
|
||||
if (lines[y][x - 1] && langles[lines[y][x - 1][1]]) {
|
||||
if (!this.options.ignoreDockContrast) {
|
||||
if (lines[y][x - 1][0] !== attr) return ch;
|
||||
}
|
||||
angle |= 1 << 3;
|
||||
}
|
||||
|
||||
if (lines[y - 1] && uangles[lines[y - 1][x][1]]) {
|
||||
if (!this.options.ignoreDockContrast) {
|
||||
if (lines[y - 1][x][0] !== attr) return ch;
|
||||
}
|
||||
angle |= 1 << 2;
|
||||
}
|
||||
|
||||
if (lines[y][x + 1] && rangles[lines[y][x + 1][1]]) {
|
||||
if (!this.options.ignoreDockContrast) {
|
||||
if (lines[y][x + 1][0] !== attr) return ch;
|
||||
}
|
||||
angle |= 1 << 1;
|
||||
}
|
||||
|
||||
if (lines[y + 1] && dangles[lines[y + 1][x][1]]) {
|
||||
if (!this.options.ignoreDockContrast) {
|
||||
if (lines[y + 1][x][0] !== attr) return ch;
|
||||
}
|
||||
angle |= 1 << 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue