Define Item#globalMatrix.

For now uncached.
This commit is contained in:
Jürg Lehni 2011-12-20 11:39:36 +01:00
parent 5797b78c2c
commit 89a1d2fe73

View file

@ -539,6 +539,18 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
// Use Matrix#initialize to easily copy over values.
this._matrix.initialize(matrix);
this._changed(Change.GEOMETRY);
},
getGlobalMatrix: function() {
// TODO: Implement caching?
var matrix = new Matrix(),
item = this;
while (item) {
if (!item._matrix.isIdentity())
matrix.preConcatenate(item._matrix);
item = item._parent;
}
return matrix;
}
}, Base.each(['bounds', 'strokeBounds', 'handleBounds', 'roughBounds'],
function(name) {