mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 06:10:14 -04:00
Replace Base.create() calls in favor of faster direct constructors.
This commit is contained in:
parent
7e24de7c74
commit
772c83596f
1 changed files with 3 additions and 3 deletions
|
@ -390,7 +390,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
|
|||
var x = point.x,
|
||||
y = point.y;
|
||||
if (!dest)
|
||||
dest = Base.create(Point);
|
||||
dest = new Point();
|
||||
return dest.set(
|
||||
x * this._a + y * this._b + this._tx,
|
||||
x * this._c + y * this._d + this._ty,
|
||||
|
@ -437,7 +437,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
|
|||
max[j] = val;
|
||||
}
|
||||
if (!dest)
|
||||
dest = Base.create(Rectangle);
|
||||
dest = new Rectangle();
|
||||
return dest.set(min[0], min[1], max[0] - min[0], max[1] - min[1],
|
||||
dontNotify);
|
||||
},
|
||||
|
@ -469,7 +469,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
|
|||
var x = point.x - this._tx,
|
||||
y = point.y - this._ty;
|
||||
if (!dest)
|
||||
dest = Base.create(Point);
|
||||
dest = new Point();
|
||||
return dest.set(
|
||||
(x * this._d - y * this._b) / det,
|
||||
(y * this._a - x * this._c) / det,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue