Stop atlas flickering on demo

This commit is contained in:
Daniel Imms
2022-10-29 12:49:11 -07:00
parent 713baeb64d
commit c6e3cc007c
+7
View File
@@ -1,3 +1,4 @@
/* eslint-disable no-restricted-syntax */
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
@@ -650,11 +651,17 @@ function htmlSerializeButtonHandler(): void {
}
function setTextureAtlas(e: HTMLCanvasElement): void {
styleAtlasPage(e);
document.querySelector('#texture-atlas').replaceChildren(e);
}
function appendTextureAtlas(e: HTMLCanvasElement): void {
styleAtlasPage(e);
document.querySelector('#texture-atlas').appendChild(e);
}
function styleAtlasPage(e: HTMLCanvasElement): void {
e.style.width = `${e.width / window.devicePixelRatio}px`;
e.style.height = `${e.height / window.devicePixelRatio}px`;
}
function writeCustomGlyphHandler(): void {
term.write('\n\r');