Merge pull request #999 from Tyriar/vscode34493

Only refresh char atlas when char dimensions are valid
This commit is contained in:
Daniel Imms
2017-09-25 06:14:58 -07:00
committed by GitHub
+4 -1
View File
@@ -57,6 +57,9 @@ 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) {
return;
}
this._charAtlas = null;
const result = acquireCharAtlas(terminal, this._colors, this._scaledCharWidth, this._scaledCharHeight);
if (result instanceof HTMLCanvasElement) {
@@ -253,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;