diff --git a/src/core/graphics/webgl/GraphicsRenderer.js b/src/core/graphics/webgl/GraphicsRenderer.js index c518279..b0217c3 100644 --- a/src/core/graphics/webgl/GraphicsRenderer.js +++ b/src/core/graphics/webgl/GraphicsRenderer.js @@ -375,7 +375,9 @@ this.quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height, recPoints); this.quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius, recPoints); this.quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y, recPoints); - this.quadraticBezierCurve(x + radius, y, x, y, x, y + radius, recPoints); + this.quadraticBezierCurve(x + radius, y, x, y, x, y + radius + 0.0000000001, recPoints); + // this tiny number deals with the issue that occurs when points overlap and polyK fails to triangulate the item. + // TODO - fix this properly, this is not very elegant.. but it works for now. if (graphicsData.fill) { @@ -391,9 +393,10 @@ var vecPos = verts.length/6; + console.log(recPoints) //TODO use this https://github.com/mapbox/earcut var triangles = utils.PolyK.Triangulate(recPoints); - + console.log(triangles) // var i = 0;