Adapt to recent changes to Matrix#decompose() in SvgExport code.

This commit is contained in:
Jürg Lehni 2013-02-09 12:11:56 -08:00
parent be3b257175
commit d70fdb69d3

View file

@ -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;