From 1413094be2901be946c9721466e618b0001656ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 7 May 2011 13:12:46 +0100 Subject: [PATCH] Shorten PlacedSymbol#initialize(). --- src/item/PlacedSymbol.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/item/PlacedSymbol.js b/src/item/PlacedSymbol.js index b46deaa3..e65cc5b2 100644 --- a/src/item/PlacedSymbol.js +++ b/src/item/PlacedSymbol.js @@ -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) {