mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-29 23:29:06 -04:00
Make argument reading more flexible by introducing options object for readNull and clone, and passing it on to the constructor through this.__options for additional values.
This commit is contained in:
parent
2c578d0558
commit
e8765d18d5
8 changed files with 83 additions and 73 deletions
src/basic
|
@ -162,7 +162,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
|
|||
// Do not modify scale, center, since that would arguments of which
|
||||
// we're reading from!
|
||||
var scale = Point.read(arguments),
|
||||
center = Point.read(arguments, 0, 0, true); // readNull
|
||||
center = Point.read(arguments, 0, 0, { readNull: true });
|
||||
if (center)
|
||||
this.translate(center);
|
||||
this._a *= scale.x;
|
||||
|
@ -267,7 +267,7 @@ var Matrix = Base.extend(/** @lends Matrix# */{
|
|||
// Do not modify point, center, since that would arguments of which
|
||||
// we're reading from!
|
||||
var point = Point.read(arguments),
|
||||
center = Point.read(arguments, 0, 0, true); // readNull
|
||||
center = Point.read(arguments, 0, 0, { readNull: true });
|
||||
if (center)
|
||||
this.translate(center);
|
||||
var a = this._a,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue