mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-22 07:19:57 -05:00
Adapt to recent changes to Matrix#decompose() in SvgExport code.
This commit is contained in:
parent
be3b257175
commit
d70fdb69d3
1 changed files with 4 additions and 4 deletions
|
@ -44,8 +44,7 @@ new function() {
|
||||||
|
|
||||||
function getTransform(item, coordinates) {
|
function getTransform(item, coordinates) {
|
||||||
var matrix = item._matrix,
|
var matrix = item._matrix,
|
||||||
decomposed = matrix.decompose(),
|
trans = matrix.getTranslation(),
|
||||||
trans = decomposed.translation,
|
|
||||||
attrs = {};
|
attrs = {};
|
||||||
if (coordinates) {
|
if (coordinates) {
|
||||||
// If the item suppports x- and y- coordinates, we're taking out the
|
// If the item suppports x- and y- coordinates, we're taking out the
|
||||||
|
@ -62,9 +61,10 @@ new function() {
|
||||||
}
|
}
|
||||||
if (matrix.isIdentity())
|
if (matrix.isIdentity())
|
||||||
return attrs;
|
return attrs;
|
||||||
// See if we can formulate the decomposed matrix as a simple
|
// See if we can decompose the matrix and can formulate it as a simple
|
||||||
// translate/scale/rotate command sequence.
|
// translate/scale/rotate command sequence.
|
||||||
if (!decomposed.shearing) {
|
var decomposed = matrix.decompose();
|
||||||
|
if (decomposed && !decomposed.shearing) {
|
||||||
var parts = [],
|
var parts = [],
|
||||||
angle = decomposed.rotation,
|
angle = decomposed.rotation,
|
||||||
scale = decomposed.scaling;
|
scale = decomposed.scaling;
|
||||||
|
|
Loading…
Reference in a new issue