diff --git a/src/basic/Matrix.js b/src/basic/Matrix.js index b9ea1828..fb9a592d 100644 --- a/src/basic/Matrix.js +++ b/src/basic/Matrix.js @@ -69,8 +69,9 @@ var Matrix = Base.extend(/** @lends Matrix# */{ } else { ok = false; } - if (!ok) + if (!ok) { throw new Error('Unsupported matrix parameters'); + } }, /** @@ -129,8 +130,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{ equals: function(mx) { return mx === this || mx && this._a === mx._a && this._b === mx._b && this._c === mx._c && this._d === mx._d - && this._tx === mx._tx && this._ty === mx._ty - || false; + && this._tx === mx._tx && this._ty === mx._ty; }, /** diff --git a/src/svg/SvgExport.js b/src/svg/SvgExport.js index 97193f0e..ca3fe493 100644 --- a/src/svg/SvgExport.js +++ b/src/svg/SvgExport.js @@ -405,9 +405,8 @@ new function() { var children = this._children, view = this.getView(), bounds = Base.pick(options.bounds, 'view'), - matrix = Matrix.read( - [options.matrix || bounds === 'view' && view._matrix], - 0, { readNull: true }), + mx = options.matrix || bounds === 'view' && view._matrix, + matrix = mx && Matrix.read([mx]), rect = bounds === 'view' ? new Rectangle([0, 0], view.getViewSize()) : bounds === 'content' diff --git a/test/helpers.js b/test/helpers.js index 43df4d26..5d07d772 100644 --- a/test/helpers.js +++ b/test/helpers.js @@ -471,7 +471,10 @@ var compareSVG = function(done, actual, expected, message, options) { return item instanceof Item ? item : typeof item === 'string' - ? new Raster('data:image/svg+xml;base64,' + btoa(item)) + ? new Raster({ + source: 'data:image/svg+xml;base64,' + btoa(item), + insert: false + }) : null; } diff --git a/test/tests/SvgExport.js b/test/tests/SvgExport.js index 95ded116..e8d1303a 100644 --- a/test/tests/SvgExport.js +++ b/test/tests/SvgExport.js @@ -143,7 +143,6 @@ test('Export transformed shapes', function(assert) { fillColor: 'yellow' }); rect.rotate(-20); - var svg = project.exportSVG({ asString: true, bounds: 'content' }); - console.log(svg); + var svg = project.exportSVG({ bounds: 'content', asString: true }); compareSVG(assert.async(), svg, project.activeLayer); });