Return a LinkedPoint from Item#scaling.

Closes #544,
This commit is contained in:
Jürg Lehni 2014-11-09 07:46:45 -08:00
parent 892c1a28bd
commit 0fb7e49248

View file

@ -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.