mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Rename Matrix#setIdentity() to #reset() and document it.
This commit is contained in:
parent
9aaa864f81
commit
cd9fc39f54
2 changed files with 7 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue