Skip to content

Conversation

Forchapeatl
Copy link
Contributor

@Forchapeatl Forchapeatl commented Mar 4, 2025

Resolves #7532

Changes:
Ensures this.clipPath.closePath happens on drawShape() before any new shape starts.

Screenshots of the change:

before:

Screenshot from 2025-03-04 20-44-57

after:

Screenshot from 2025-03-04 20-46-07

snippet:

var myImg;


async function setup() {
  createCanvas(400, 400);
  noSmooth();
  myImg = await loadImage("Stone_Retaining_wall.jpg");

}

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);
}

PR Checklist

Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Forchapeatl!

@davepagurek davepagurek merged commit e37bfa6 into processing:dev-2.0 Mar 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants