diff --git a/src/item/Item.js b/src/item/Item.js index 1a3b0f70..1b3f5d0a 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -209,7 +209,7 @@ new function() { // Injection scope for various item event handlers * @param {ChangeFlag} flags describes what exactly has changed */ _changed: function(flags) { - var symbol = this._parentSymbol, + var symbol = this._symbol, cacheParent = this._parent || symbol, project = this._project; if (flags & /*#=*/ChangeFlag.GEOMETRY) { @@ -911,7 +911,7 @@ new function() { // Injection scope for various item event handlers ].join(''); // NOTE: This needs to happen before returning cached values, since even // then, _boundsCache needs to be kept up-to-date. - Item._updateBoundsCache(this._parent || this._parentSymbol, cacheItem); + Item._updateBoundsCache(this._parent || this._symbol, cacheItem); if (cacheKey && this._bounds && cacheKey in this._bounds) return this._bounds[cacheKey].rect.clone(); var bounds = this._getBounds(matrix || _matrix, options); @@ -936,9 +936,10 @@ new function() { // Injection scope for various item event handlers * is always shiftless, meaning its translation vector is reset to zero. */ _getStrokeMatrix: function(matrix, options) { - var mx = this.getStrokeScaling() ? matrix : (options && options.internal - ? this : this._parent || this._parentSymbol._item) - .getViewMatrix().invert(); + var parent = this.getStrokeScaling() ? null + : options && options.internal ? this + : this._parent || this._symbol && this._symbol._item, + mx = parent ? parent.getViewMatrix().invert() : matrix; return mx && mx._shiftless(); }, diff --git a/src/item/SymbolDefinition.js b/src/item/SymbolDefinition.js index 82db8d8b..2ae5556b 100644 --- a/src/item/SymbolDefinition.js +++ b/src/item/SymbolDefinition.js @@ -104,11 +104,11 @@ var SymbolDefinition = Base.extend(/** @lends SymbolDefinition# */{ setItem: function(item, _dontCenter) { // Make sure we're not stealing another symbol's definition - if (item._parentSymbol) + if (item._symbol) item = item.clone(); // Remove previous definition's reference to this symbol if (this._item) - this._item._parentSymbol = null; + this._item._symbol = null; this._item = item; // Remove item from DOM, as it's embedded in Symbol now. item.remove(); @@ -116,7 +116,7 @@ var SymbolDefinition = Base.extend(/** @lends SymbolDefinition# */{ // Move position to 0, 0, so it's centered when placed. if (!_dontCenter) item.setPosition(new Point()); - item._parentSymbol = this; + item._symbol = this; this._changed(/*#=*/Change.GEOMETRY); },