mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Shorten PlacedSymbol#initialize().
This commit is contained in:
parent
15b7cfec0b
commit
1413094be2
1 changed files with 6 additions and 16 deletions
|
@ -19,22 +19,12 @@ var PlacedSymbol = this.PlacedSymbol = Item.extend({
|
|||
|
||||
initialize: function(symbol, matrixOrOffset) {
|
||||
this.base();
|
||||
if (symbol instanceof Symbol) {
|
||||
this.symbol = symbol;
|
||||
} else {
|
||||
this.symbol = new Symbol(symbol);
|
||||
}
|
||||
this._position = this.symbol._definition.getPosition();
|
||||
if (matrixOrOffset !== undefined) {
|
||||
if (matrixOrOffset instanceof Matrix) {
|
||||
this.matrix = matrixOrOffset;
|
||||
} else {
|
||||
this.matrix = new Matrix().translate(Point.read(arguments, 1));
|
||||
}
|
||||
this._position = this.matrix._transformPoint(this._position);
|
||||
} else {
|
||||
this.matrix = new Matrix();
|
||||
}
|
||||
this.symbol = symbol instanceof Symbol ? symbol : new Symbol(symbol);
|
||||
this.matrix = matrixOrOffset !== undefined
|
||||
? matrixOrOffset instanceof Matrix
|
||||
? matrixOrOffset
|
||||
: new Matrix().translate(Point.read(arguments, 1))
|
||||
: new Matrix();
|
||||
},
|
||||
|
||||
_transform: function(matrix, flags) {
|
||||
|
|
Loading…
Reference in a new issue