Skip to content

Commit 4cea5a8

Browse files
authored
Merge pull request #6480 from Gaurav-1306/resize
resolved issue #6399
2 parents 144bf30 + 213d8fb commit 4cea5a8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/webgl/p5.RendererGL.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,15 @@ p5.RendererGL = class RendererGL extends p5.Renderer {
996996
// geometries/borders on this layer should always be invisible
997997
this.filterGraphicsLayer.noStroke();
998998
}
999-
999+
else if(
1000+
this.filterGraphicsLayer.width !== this.width ||
1001+
this.filterGraphicsLayer.height !== this.height ||
1002+
this.filterGraphicsLayer.pixelDensity() !== this._pInst.pixelDensity()
1003+
){
1004+
// Resize the graphics layer
1005+
this.filterGraphicsLayer.resizeCanvas(this.width, this.height);
1006+
this.filterGraphicsLayer.pixelDensity(this._pInst.pixelDensity());
1007+
}
10001008

10011009
let pg = this.filterGraphicsLayer;
10021010

0 commit comments

Comments
 (0)