Closed
Description
Most appropriate sub-area of p5.js?
- Accessibility
- Color
- Core/Environment/Rendering
- Data
- DOM
- Events
- Image
- IO
- Math
- Typography
- Utilities
- WebGL
- Build process
- Unit testing
- Internationalization
- Friendly errors
- Other (specify if possible)
p5.js version
1.11.1
Web browser and version
Chrome 132.0.6834.160
Operating system
Windows 10
Steps to reproduce this
Steps:
- Begin Clip
- Create a shape with beginShape() and endShape()
- Throw in a circle
- End Clip
Snippet:
var myImg;
function preload(){
myImg = loadImage("dirt_walls.png");
}
function setup() {
createCanvas(400, 400);
noSmooth();
}
function draw() {
background(220);
beginClip();
beginShape();
vertex(100,100);
vertex(200,100);
vertex(200,200);
vertex(100,200);
endShape();
beginShape();
vertex(200,150);
vertex(300,150);
vertex(300,250);
vertex(200,250);
endShape();
circle(200,250,50);
endClip();
image(myImg,0,0);
}
It looks like the circle is moving the vertex from the second shape over:
This is the reason I want it fixed, I'm using marching squares with beingShape() to clip an image: