Most appropriate sub-area of p5.js?
p5.js version
1.8.0
Web browser and version
No response
Operating System
No response
Steps to reproduce this
I'm a bit confused about the arguments of createCanvas.
In this part where detecting the case createCanvas(w, h, canvas):
|
if (arguments[2] instanceof HTMLCanvasElement) { |
|
renderer = constants.P2D; |
|
canvas = arguments[2]; |
|
} else { |
|
r = renderer || constants.P2D; |
|
} |
I think instead of the variable renderer (which is not used afterwards), the constant should be assigned to r. Furthermore, to me it makes sense to rename the arguments to createCanvas(w, h, ...args) or so and unpack it later to avoid duplication of r, renderer and so on.
The change seemed to be introduced with this PR (nevertheless I really love this feature) #6229
Most appropriate sub-area of p5.js?
p5.js version
1.8.0
Web browser and version
No response
Operating System
No response
Steps to reproduce this
I'm a bit confused about the arguments of
createCanvas.In this part where detecting the case
createCanvas(w, h, canvas):p5.js/src/core/rendering.js
Lines 76 to 81 in 8e97213
I think instead of the variable
renderer(which is not used afterwards), the constant should be assigned tor. Furthermore, to me it makes sense to rename the arguments tocreateCanvas(w, h, ...args)or so and unpack it later to avoid duplication ofr,rendererand so on.The change seemed to be introduced with this PR (nevertheless I really love this feature) #6229