Merge pull request #4193 from silamon/fixdemoagain

Fix demo again
This commit is contained in:
Daniel Imms
2022-10-09 09:23:07 -07:00
committed by GitHub
2 changed files with 14 additions and 4 deletions
+10 -3
View File
@@ -273,11 +273,18 @@ function createTerminal(): void {
addons.fit.instance!.fit();
typedTerm.loadAddon(addons.webgl.instance);
setTimeout(() => {
addTextureAtlas(addons.webgl.instance.textureAtlas);
addons.webgl.instance.onChangeTextureAtlas(e => addTextureAtlas(e));
if (addons.webgl.instance !== undefined) {
addTextureAtlas(addons.webgl.instance.textureAtlas);
addons.webgl.instance.onChangeTextureAtlas(e => addTextureAtlas(e));
}
}, 0);
term.open(terminalContainer);
try { // try-catch to allow the demo to load if webgl is not supported
term.open(terminalContainer);
}
catch {
addons.webgl.instance = undefined;
}
term.focus();
addDomListener(paddingElement, 'change', setPadding);
+4 -1
View File
@@ -515,7 +515,10 @@ export class Terminal extends CoreTerminal implements ITerminal {
// Performance: Add viewport and helper elements from the fragment
this.element.appendChild(fragment);
this._onWillOpen.fire(this.element);
try {
this._onWillOpen.fire(this.element);
}
catch { /* fails to load addon for some reason */ }
if (!this._renderService.hasRenderer()) {
this._renderService.setRenderer(this._createRenderer());
}