Skip to content

Commit b574be6

Browse files
authored
Merge pull request #7495 from processing/fix/closed-curves
Fix closed curves having extra loops
2 parents c7ee241 + c4fc913 commit b574be6

File tree

8 files changed

+17
-1
lines changed

8 files changed

+17
-1
lines changed

src/shape/custom_shapes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ class SplineSegment extends Segment {
395395
points.unshift(prevVertex);
396396
points.push(this.vertices.at(-1));
397397
} else if (this._splineProperties.ends === constants.JOIN) {
398-
points.unshift(this.vertices.at(-1), prevVertex);
398+
points.unshift(this.vertices.at(-1));
399399
points.push(prevVertex, this.vertices.at(0));
400400
}
401401

test/unit/visual/cases/shapes.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ visualSuite('Shape drawing', function() {
150150
screenshot();
151151
});
152152

153+
visualTest('Drawing simple closed curves', function(p5, screenshot) {
154+
setup(p5);
155+
p5.beginShape();
156+
p5.splineVertex(10, 10);
157+
p5.splineVertex(15, 40);
158+
p5.splineVertex(40, 35);
159+
p5.endShape(p5.CLOSE);
160+
screenshot();
161+
});
162+
153163
visualTest('Drawing with curves with tightness', function(p5, screenshot) {
154164
setup(p5);
155165
p5.splineProperty('tightness', -1);
Loading
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}
Loading
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"numScreenshots": 1
3+
}

0 commit comments

Comments
 (0)