diff --git a/canvas2svg.js b/canvas2svg.js index d79d6bc..0964b39 100644 --- a/canvas2svg.js +++ b/canvas2svg.js @@ -930,6 +930,10 @@ * Arc command! */ ctx.prototype.arc = function(x, y, radius, startAngle, endAngle, counterClockwise) { + // in canvas no circle is drawn if no angle is provided. + if (startAngle === endAngle) { + return; + } startAngle = startAngle % (2*Math.PI); endAngle = endAngle % (2*Math.PI); if(startAngle === endAngle) { diff --git a/test/example/emptyArc.js b/test/example/emptyArc.js new file mode 100644 index 0000000..0ad71f9 --- /dev/null +++ b/test/example/emptyArc.js @@ -0,0 +1,12 @@ +window.C2S_EXAMPLES['emptyArc'] = function(ctx) { + + // Draw shapes + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + ctx.beginPath(); + ctx.arc(100, 100, 100, Math.PI, Math.PI); + ctx.fill(); + } + } + +}; diff --git a/test/playground.html b/test/playground.html index 6ccf53c..ab1cad2 100644 --- a/test/playground.html +++ b/test/playground.html @@ -20,7 +20,7 @@