Introduce Matrix#setIdentity().

This commit is contained in:
Jürg Lehni 2011-12-20 23:14:30 +01:00
parent a8392fbf68
commit f2d7b85616
2 changed files with 7 additions and 5 deletions
src/basic

View file

@ -66,8 +66,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
ok = false;
}
} else if (count == 0) {
this._a = this._d = 1;
this._c = this._b = this._tx = this._ty = 0;
this.setIdentity();
} else {
ok = false;
}
@ -104,6 +103,11 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
return this;
},
setIdentity: function() {
this._a = this._d = 1;
this._c = this._b = this._tx = this._ty = 0;
},
/**
* Concatentates this transform with a scaling transformation.
*