Set background color on Renderer immediately

Prevents black flash on init
This commit is contained in:
Daniel Imms
2017-09-14 00:22:57 -07:00
parent c2b765f3ff
commit aca7ab63e8
9 changed files with 79 additions and 76 deletions
+4 -4
View File
@@ -136,7 +136,7 @@ export class TextRenderLayer extends BaseRenderLayer {
// Draw background
if (bg < 256) {
this._ctx.save();
this._ctx.fillStyle = (bg === INVERTED_DEFAULT_COLOR ? this.colors.foreground : this.colors.ansi[bg]);
this._ctx.fillStyle = (bg === INVERTED_DEFAULT_COLOR ? this._colors.foreground : this._colors.ansi[bg]);
this.fillCells(x, y, width, 1);
this._ctx.restore();
}
@@ -152,12 +152,12 @@ export class TextRenderLayer extends BaseRenderLayer {
if (flags & FLAGS.UNDERLINE) {
if (fg === INVERTED_DEFAULT_COLOR) {
this._ctx.fillStyle = this.colors.background;
this._ctx.fillStyle = this._colors.background;
} else if (fg < 256) {
// 256 color support
this._ctx.fillStyle = this.colors.ansi[fg];
this._ctx.fillStyle = this._colors.ansi[fg];
} else {
this._ctx.fillStyle = this.colors.foreground;
this._ctx.fillStyle = this._colors.foreground;
}
this.fillBottomLineAtCells(x, y);
}