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:
Jürg Lehni 2013-06-28 07:37:03 -07:00
parent 2c578d0558
commit e8765d18d5
8 changed files with 83 additions and 73 deletions
src/basic

View file

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