From 00b13ff17c21d9de5489422b40266a1bc24c238b Mon Sep 17 00:00:00 2001 From: Garima Date: Sat, 28 Oct 2023 19:07:03 +0530 Subject: [PATCH] Solves issue #6502 --- src/webgl/p5.RendererGL.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/webgl/p5.RendererGL.js b/src/webgl/p5.RendererGL.js index 3542584674..90162f00bc 100644 --- a/src/webgl/p5.RendererGL.js +++ b/src/webgl/p5.RendererGL.js @@ -1127,6 +1127,9 @@ p5.RendererGL = class RendererGL extends p5.Renderer { } // draw pg contents onto main renderer this._pInst.push(); + this._pInst.resetMatrix(); // Reset the transformation matrix to identity + this._pInst.clear(); // Clear the canvas + this._pInst.blendMode(this._pInst.BLEND); // Set blend mode to BLEND this._pInst.noStroke(); this._pInst.image(pg, -this.width/2, -this.height/2, this.width, this.height);