Skip to content

Commit

Permalink
fixes #1362
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren McCarthy committed Apr 25, 2016
1 parent e37cc46 commit ad57997
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/vertex.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ var isBezier = false;
var isCurve = false;
var isQuadratic = false;
var isContour = false;
var isFirstContour = true;

/**
* Use the beginContour() and endContour() functions to create negative
Expand Down Expand Up @@ -389,7 +390,12 @@ p5.prototype.endContour = function() {
vert.moveTo = false;
contourVertices.push(vert);

vertices.push(vertices[0]);
// prevent stay lines with multiple contours

This comment has been minimized.

Copy link
@raphaelschaad

raphaelschaad Apr 25, 2016

typo: stay -> stray

if (isFirstContour) {
vertices.push(vertices[0]);
isFirstContour = false;
}

for (var i = 0; i < contourVertices.length; i++) {
vertices.push(contourVertices[i]);
}
Expand Down Expand Up @@ -447,6 +453,7 @@ p5.prototype.endShape = function(mode) {
isBezier = false;
isQuadratic = false;
isContour = false;
isFirstContour = true;

// If the shape is closed, the first element was added as last element.
// We must remove it again to prevent the list of vertices from growing
Expand Down

1 comment on commit ad57997

@raphaelschaad
Copy link

Choose a reason for hiding this comment

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

Nice! 👏

Please sign in to comment.