Support invisible attr

This commit is contained in:
Daniel Imms
2017-09-01 20:51:18 -07:00
parent bf95333275
commit 1f444b1913
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -80,7 +80,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
this._ctx.clearRect(startCol * this.scaledCharWidth, startRow * this.scaledCharHeight, colWidth * this.scaledCharWidth, colHeight * this.scaledCharHeight);
}
protected drawChar(terminal: ITerminal, char: string, code: number, fg: number, x: number, y: number): void {
protected drawChar(terminal: ITerminal, char: string, code: number, x: number, y: number, fg: number): void {
let colorIndex = 0;
if (fg < 256) {
colorIndex = fg + 1;
+1 -1
View File
@@ -116,7 +116,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
private _renderBlockCursor(terminal: ITerminal, x: number, y: number, charData: CharData): void {
this.fillCells(x, y, 1, 1);
this.drawChar(terminal, charData[CHAR_DATA_CHAR_INDEX], <number>charData[CHAR_DATA_CODE_INDEX], COLOR_CODES.BLACK, x, y);
this.drawChar(terminal, charData[CHAR_DATA_CHAR_INDEX], <number>charData[CHAR_DATA_CODE_INDEX], x, y, COLOR_CODES.BLACK);
}
private _renderUnderlineCursor(terminal: ITerminal, x: number, y: number, charData: CharData): void {
+4 -3
View File
@@ -61,13 +61,14 @@ export class ForegroundRenderLayer extends BaseRenderLayer {
}
this._state.cache[x][y] = charData;
const flags = attr >> 18;
// Skip rendering if the character is invisible
if (!code || code === 32 /*' '*/) {
if (!code || code === 32 /*' '*/ || (flags & FLAGS.INVISIBLE)) {
continue;
}
let fg = (attr >> 9) & 0x1ff;
const flags = attr >> 18;
// If inverse flag is on, the foreground should become the background.
if (flags & FLAGS.INVERSE) {
@@ -87,7 +88,7 @@ export class ForegroundRenderLayer extends BaseRenderLayer {
}
}
this.drawChar(terminal, char, code, fg, x, y);
this.drawChar(terminal, char, code, x, y, fg);
this._ctx.restore();
}
}