Skip to content

Commit d7f82d1

Browse files
authored
Merge pull request #1951 from mlarghydracept/tint_with_createGraphics
Tint with createGraphics
2 parents e096d85 + e0dfa64 commit d7f82d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/core/p5.Graphics.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ p5.Graphics = function(w, h, renderer, pInst) {
2525

2626
var r = renderer || constants.P2D;
2727

28-
var c = document.createElement('canvas');
28+
this.canvas = document.createElement('canvas');
2929
var node = this._userNode || document.body;
30-
node.appendChild(c);
30+
node.appendChild(this.canvas);
3131

32-
p5.Element.call(this, c, pInst, false);
32+
p5.Element.call(this, this.canvas, pInst, false);
3333
this._styles = [];
3434
this.width = w;
3535
this.height = h;
3636
this._pixelDensity = pInst._pixelDensity;
3737

3838
if (r === constants.WEBGL) {
39-
this._renderer = new p5.RendererGL(c, this, false);
39+
this._renderer = new p5.RendererGL(this.canvas, this, false);
4040
} else {
41-
this._renderer = new p5.Renderer2D(c, this, false);
41+
this._renderer = new p5.Renderer2D(this.canvas, this, false);
4242
}
4343

4444
this._renderer.resize(w, h);

0 commit comments

Comments
 (0)