From 8d0fecbb1b251cba4a68c8f2c2f775e1061e4a06 Mon Sep 17 00:00:00 2001 From: DD Date: Wed, 27 Jun 2018 16:29:46 -0400 Subject: [PATCH 1/2] For SVG import, If second argument is missing in translate, assume that it's zero. Currently it assumes that y matches x if y is missing. --- src/svg/SvgImport.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index 32b76c47..2ca7bdd2 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -339,7 +339,8 @@ new function() { matrix.rotate(v[0], v[1], v[2]); break; case 'translate': - matrix.translate(v[0], v[1]); + var v1 = (typeof v[1] === 'number') ? v[1] : 0; + matrix.translate(v[0], v1); break; case 'scale': matrix.scale(v); From bf63bf223c9aaa4b2e5b406d05a83d1262fee4d0 Mon Sep 17 00:00:00 2001 From: DD Date: Wed, 27 Jun 2018 16:47:19 -0400 Subject: [PATCH 2/2] Add rotate case as well --- src/svg/SvgImport.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svg/SvgImport.js b/src/svg/SvgImport.js index 2ca7bdd2..6a09b761 100644 --- a/src/svg/SvgImport.js +++ b/src/svg/SvgImport.js @@ -336,7 +336,8 @@ new function() { new Matrix(v[0], v[1], v[2], v[3], v[4], v[5])); break; case 'rotate': - matrix.rotate(v[0], v[1], v[2]); + var v2 = (typeof v[1] === 'number' && typeof v[2] !== 'number') ? 0 : v[2]; + matrix.rotate(v[0], v[1], v2); break; case 'translate': var v1 = (typeof v[1] === 'number') ? v[1] : 0;