p5.js
p5.js copied to clipboard
Caps at beginning of curve
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:
After:
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:
PR Checklist
- [ ]
npm run lintpasses - [ ] Inline documentation is included / updated
- [ ] Unit tests are included / updated
I think there is redundancy in storing values that is why the tests fail. I will look into it as soon as possible.