Rename Matrix#setIdentity() to #reset() and document it.

This commit is contained in:
Jürg Lehni 2013-02-09 11:45:33 -08:00
parent 9aaa864f81
commit cd9fc39f54
2 changed files with 7 additions and 3 deletions

View file

@ -64,7 +64,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
ok = false;
}
} else if (count == 0) {
this.setIdentity();
this.reset();
} else {
ok = false;
}
@ -105,7 +105,11 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
return this;
},
setIdentity: function() {
/**
* "Resets" the matrix by setting its values to the ones of the identity
* matrix that results in no transformation.
*/
reset: function() {
this._a = this._d = 1;
this._c = this._b = this._tx = this._ty = 0;
return this;

View file

@ -1944,7 +1944,7 @@ var Item = this.Item = Base.extend(Callback, /** @lends Item# */{
// storing the actual location / transformation state.
if ((this.applyMatrix || arguments[1])
&& this._applyMatrix(this._matrix))
this._matrix.setIdentity();
this._matrix.reset();
// We always need to call _changed since we're caching bounds on all
// items, including Group.
this._changed(/*#=*/ Change.GEOMETRY);