mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Define Item#globalMatrix.
For now uncached.
This commit is contained in:
parent
5797b78c2c
commit
89a1d2fe73
1 changed files with 12 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue