From 0fb7e49248ac749270cf9a8d8017a7f24a155f6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 9 Nov 2014 07:46:45 -0800 Subject: [PATCH] Return a LinkedPoint from Item#scaling. Closes #544, --- src/item/Item.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/item/Item.js b/src/item/Item.js index fe42264a..044513c6 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1092,14 +1092,16 @@ var Item = Base.extend(Emitter, /** @lends Item# */{ * @type Point * @bean */ - getScaling: function() { - var decomposed = this._decomposed || this._decompose(); - return decomposed && decomposed.scaling; + getScaling: function(_dontLink) { + var decomposed = this._decomposed || this._decompose(), + scaling = decomposed && decomposed.scaling, + ctor = _dontLink ? Point : LinkedPoint; + return scaling && new ctor(scaling.x, scaling.y, this, 'setScaling'); }, setScaling: function(/* scaling */) { var current = this.getScaling(); - if (current != null) { + if (current) { // Clone existing points since we're caching internally. var scaling = Point.read(arguments, 0, { clone: true }), // See #setRotation() for preservation of _decomposed.