From 0b16b0c346aabd9ca27cc987b79929d5a256f57c Mon Sep 17 00:00:00 2001 From: Michael Deal Date: Thu, 28 Jul 2016 01:07:38 -0700 Subject: [PATCH] fix issue in ctx.closePath() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prevents path from starting with ā€˜Zā€™ and throwing an error --- canvas2svg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/canvas2svg.js b/canvas2svg.js index 03dc392..7599402 100644 --- a/canvas2svg.js +++ b/canvas2svg.js @@ -585,7 +585,9 @@ * Closes the current path */ ctx.prototype.closePath = function(){ - this.__addPathCommand("Z"); + if (this.__currentDefaultPath) { + this.__addPathCommand("Z"); + } }; /**