diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index 8fded40..3e7f088 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -643,7 +643,16 @@ if (points) { - if (points[points.length - 2] !== startX || points[points.length - 1] !== startY) + // We check how far our start is from the last existing point + const xDiff = Math.abs(points[points.length - 2] - startX); + const yDiff = Math.abs(points[points.length - 1] - startY); + + if (xDiff < 0.001 && yDiff < 0.001) + { + // If the point is very close, we don't add it, since this would lead to artifacts + // during tesselation due to floating point imprecision. + } + else { points.push(startX, startY); }