mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Use faster Point.create().
This commit is contained in:
parent
a1ec8b7db1
commit
a21d180150
1 changed files with 3 additions and 2 deletions
|
@ -106,6 +106,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
setIdentity: function() {
|
||||
this._a = this._d = 1;
|
||||
this._c = this._b = this._tx = this._ty = 0;
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -472,13 +473,13 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
},
|
||||
|
||||
getTranslation: function() {
|
||||
return new Point(this._tx, this._ty);
|
||||
return Point.create(this._tx, this._ty);
|
||||
},
|
||||
|
||||
getScaling: function() {
|
||||
var hor = Math.sqrt(this._a * this._a + this._c * this._c),
|
||||
ver = Math.sqrt(this._b * this._b + this._d * this._d);
|
||||
return new Point(this._a < 0 ? -hor : hor, this._b < 0 ? -ver : ver);
|
||||
return Point.create(this._a < 0 ? -hor : hor, this._b < 0 ? -ver : ver);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue