You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect this to create a graphics that contains a red rectangle, and then draw a blue rectangle to that first graphics. Instead, only a single pixel is set, and it's set to transparent?
The text was updated successfully, but these errors were encountered:
I think that this feature should be present .
The reason why it is setting a single transparent pixel is the current set method checks whether the third parameter imgOrCol is an p5.Image instance or a color value. In case it is neither if them, it sets the value of the pixel mentioned as [0, 0, 0, 0].
We can check its implementation here .
We can check if the imgOrCol parameter is p5.Image instance or p5.Graphics instance,
then we can set the pixels of one p5.Graphics instance from another.
Also , if we pass a image as the third parameter set(x, y, image) the image fills the entire canvas from x, y onwards. Is this the intended behavior ?
Should we pass the height and width here
as
this.drawingContext.drawImage(imgOrCol.canvas, x, y, imgOrCol.width, imgOrCol.height);
Nature of issue?
Most appropriate sub-area of p5.js?
createGraphics()
set()
Which platform were you using when you encountered this?
Details about the bug:
From this Stack Overflow question.
It appears that the
set()
function does not work withP5.Graphics
values. Is this expected?I would expect this to create a graphics that contains a red rectangle, and then draw a blue rectangle to that first graphics. Instead, only a single pixel is set, and it's set to transparent?
The text was updated successfully, but these errors were encountered: