mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
parent
892c1a28bd
commit
0fb7e49248
1 changed files with 6 additions and 4 deletions
|
@ -1092,14 +1092,16 @@ var Item = Base.extend(Emitter, /** @lends Item# */{
|
||||||
* @type Point
|
* @type Point
|
||||||
* @bean
|
* @bean
|
||||||
*/
|
*/
|
||||||
getScaling: function() {
|
getScaling: function(_dontLink) {
|
||||||
var decomposed = this._decomposed || this._decompose();
|
var decomposed = this._decomposed || this._decompose(),
|
||||||
return decomposed && decomposed.scaling;
|
scaling = decomposed && decomposed.scaling,
|
||||||
|
ctor = _dontLink ? Point : LinkedPoint;
|
||||||
|
return scaling && new ctor(scaling.x, scaling.y, this, 'setScaling');
|
||||||
},
|
},
|
||||||
|
|
||||||
setScaling: function(/* scaling */) {
|
setScaling: function(/* scaling */) {
|
||||||
var current = this.getScaling();
|
var current = this.getScaling();
|
||||||
if (current != null) {
|
if (current) {
|
||||||
// Clone existing points since we're caching internally.
|
// Clone existing points since we're caching internally.
|
||||||
var scaling = Point.read(arguments, 0, { clone: true }),
|
var scaling = Point.read(arguments, 0, { clone: true }),
|
||||||
// See #setRotation() for preservation of _decomposed.
|
// See #setRotation() for preservation of _decomposed.
|
||||||
|
|
Loading…
Reference in a new issue