diff --git a/addons/addon-webgl/src/GlyphRenderer.ts b/addons/addon-webgl/src/GlyphRenderer.ts index 10c9ad72..6b359d4b 100644 --- a/addons/addon-webgl/src/GlyphRenderer.ts +++ b/addons/addon-webgl/src/GlyphRenderer.ts @@ -318,8 +318,8 @@ export class GlyphRenderer extends Disposable { public handleResize(): void { const gl = this._gl; gl.useProgram(this._program); - gl.viewport(0, 0, gl.canvas.width, gl.canvas.height); - gl.uniform2f(this._resolutionLocation, gl.canvas.width, gl.canvas.height); + gl.viewport(0, 0, this._dimensions.device.canvas.width, this._dimensions.device.canvas.height); + gl.uniform2f(this._resolutionLocation, this._dimensions.device.canvas.width, this._dimensions.device.canvas.height); this.clear(); } diff --git a/addons/addon-webgl/src/WebglRenderer.ts b/addons/addon-webgl/src/WebglRenderer.ts index 5e2eaffc..345437d5 100644 --- a/addons/addon-webgl/src/WebglRenderer.ts +++ b/addons/addon-webgl/src/WebglRenderer.ts @@ -622,8 +622,6 @@ export class WebglRenderer extends Disposable implements IRenderer { // the change as it's an exact multiple of the cell sizes. this._canvas.width = width; this._canvas.height = height; - // Update the WebGL viewport to match the new canvas dimensions - this._gl.viewport(0, 0, width, height); // Render synchronously to avoid flicker when the canvas is cleared this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1, sync: true }); }