mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Fix failing SVG unit test.
This commit is contained in:
parent
6f4890c63c
commit
08e51b5ca4
4 changed files with 10 additions and 9 deletions
|
@ -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;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue