p5.js icon indicating copy to clipboard operation
p5.js copied to clipboard

Caps at beginning of curve

Open diyaayay opened this issue 1 year ago • 1 comments
trafficstars

Resolves #6816 Work in progress.

Changes:

-Handles add cap at the start of the stroke if not connected

Screenshots of the change:

sketch:

function setup() {
  createCanvas(400, 400, WEBGL)
}

function draw() {
  background(255)
  stroke(0)
  strokeWeight(20)
  beginShape()
  vertex(-40, -40)
  bezierVertex(40, -40, -40, 40, 40, 40)
  endShape()
}

Before: image After: image

sketch:

function setup() {
  createCanvas(400, 400, WEBGL);
  background(255)
  noFill()
  stroke(0)
  strokeWeight(20)
  translate(-width/2, -height/2)
  beginShape()
  vertex(20, 20)
  quadraticVertex(
    280, 200,
    100, 380
  )
  endShape()
}

output: image

PR Checklist

diyaayay avatar Feb 17 '24 20:02 diyaayay

I think there is redundancy in storing values that is why the tests fail. I will look into it as soon as possible.

diyaayay avatar Feb 18 '24 03:02 diyaayay