diff --git a/src/webgl/p5.RendererGL.js b/src/webgl/p5.RendererGL.js index 88ac6eaf16..077cbc99ee 100644 --- a/src/webgl/p5.RendererGL.js +++ b/src/webgl/p5.RendererGL.js @@ -996,7 +996,15 @@ p5.RendererGL = class RendererGL extends p5.Renderer { // geometries/borders on this layer should always be invisible this.filterGraphicsLayer.noStroke(); } - + else if( + this.filterGraphicsLayer.width !== this.width || + this.filterGraphicsLayer.height !== this.height || + this.filterGraphicsLayer.pixelDensity() !== this._pInst.pixelDensity() + ){ + // Resize the graphics layer + this.filterGraphicsLayer.resizeCanvas(this.width, this.height); + this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity()); + } let pg = this.filterGraphicsLayer;