Correct if statement, ensure charAtlas exists

This commit is contained in:
Daniel Imms
2017-09-20 09:02:21 +09:00
parent 9b6c4e046f
commit 40fdd00b9e
+2 -2
View File
@@ -57,7 +57,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
* @param colorSet The color set to use for the char atlas.
*/
private _refreshCharAtlas(terminal: ITerminal, colorSet: IColorSet): void {
if (this._scaledCharWidth > 0 && this._scaledCharHeight > 0) {
if (this._scaledCharWidth <= 0 && this._scaledCharHeight <= 0) {
return;
}
this._charAtlas = null;
@@ -256,7 +256,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
const isBasicColor = (colorIndex > 1 && fg < 16);
const isDefaultColor = fg >= 256;
const isDefaultBackground = bg >= 256;
if (isAscii && (isBasicColor || isDefaultColor) && isDefaultBackground) {
if (this._charAtlas && isAscii && (isBasicColor || isDefaultColor) && isDefaultBackground) {
// ImageBitmap's draw about twice as fast as from a canvas
const charAtlasCellWidth = this._scaledCharWidth + CHAR_ATLAS_CELL_SPACING;
const charAtlasCellHeight = this._scaledCharHeight + CHAR_ATLAS_CELL_SPACING;