fix demo in epiphany

This commit is contained in:
Jörg Breitbart
2022-12-06 13:40:25 +01:00
parent ad1f2ac2a8
commit e46a9e12d0
2 changed files with 16 additions and 13 deletions
@@ -373,6 +373,9 @@ export abstract class BaseRenderLayer extends Disposable implements IRenderLayer
} else {
glyph = this._charAtlas.getRasterizedGlyph(cell.getCode() || WHITESPACE_CELL_CODE, this._cellColorResolver.result.bg, this._cellColorResolver.result.fg, this._cellColorResolver.result.ext);
}
if (!glyph.size.x || !glyph.size.y) {
return;
}
this._ctx.save();
this._clipRow(y);
// Draw the image, use the bitmap if it's available
+13 -13
View File
@@ -273,22 +273,22 @@ function createTerminal(): void {
socketURL = protocol + location.hostname + ((location.port) ? (':' + location.port) : '') + '/terminals/';
addons.fit.instance!.fit();
typedTerm.loadAddon(addons.webgl.instance);
setTimeout(() => {
if (addons.webgl.instance !== undefined) {
setTextureAtlas(addons.webgl.instance.textureAtlas);
addons.webgl.instance.onChangeTextureAtlas(e => setTextureAtlas(e));
addons.webgl.instance.onAddTextureAtlasCanvas(e => appendTextureAtlas(e));
addons.webgl.instance.onRemoveTextureAtlasCanvas(e => removeTextureAtlas(e));
}
}, 0);
try { // try-catch to allow the demo to load if webgl is not supported
// try to start with webgl renderer (might throw on older safari/webkit)
try {
typedTerm.loadAddon(addons.webgl.instance);
term.open(terminalContainer);
setTextureAtlas(addons.webgl.instance.textureAtlas);
addons.webgl.instance.onChangeTextureAtlas(e => setTextureAtlas(e));
addons.webgl.instance.onAddTextureAtlasCanvas(e => appendTextureAtlas(e));
addons.webgl.instance.onRemoveTextureAtlasCanvas(e => removeTextureAtlas(e));
} catch (e) {
console.log(e);
addons.webgl.instance.dispose();
addons.webgl.instance = undefined;
term.open(terminalContainer);
}
catch {
addons.webgl.instance = undefined;
}
term.focus();
addDomListener(paddingElement, 'change', setPadding);