Skip to content

Commit e01903d

Browse files
committed
Expose drawingContext to global mode
1 parent e9cae1f commit e01903d

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/core/main.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ class p5 {
190190
return this._renderer.pixels;
191191
}
192192

193+
get drawingContext(){
194+
return this._renderer.drawingContext;
195+
}
196+
193197
static registerAddon(addon) {
194198
const lifecycles = {};
195199
addon(p5, p5.prototype, lifecycles);

src/core/p5.Renderer2D.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ class Renderer2D extends Renderer {
6868
if(attributes.colorSpace === 'display-p3'){
6969
this.states.colorMode = RGBHDR;
7070
}
71-
if (isMainCanvas) {
72-
this._pInst.drawingContext = this.drawingContext;
73-
}
7471
this.scale(this._pixelDensity, this._pixelDensity);
7572

7673
if(!this.filterRenderer){

src/webgl/p5.RendererGL.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ class RendererGL extends Renderer {
123123
// This redundant property is useful in reminding you that you are
124124
// interacting with WebGLRenderingContext, still worth considering future removal
125125
this.GL = this.drawingContext;
126-
if (isMainCanvas) {
127-
this._pInst.drawingContext = this.drawingContext;
128-
}
129126

130127
if (this._isMainCanvas) {
131128
// for pixel method sharing with pimage

0 commit comments

Comments
 (0)