From cd9fc39f54bfc19939d658f80ccd77dfbd0d62db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sat, 9 Feb 2013 11:45:33 -0800 Subject: [PATCH] Rename Matrix#setIdentity() to #reset() and document it. --- src/basic/Matrix.js | 8 ++++++-- src/item/Item.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/basic/Matrix.js b/src/basic/Matrix.js index 872267af..a4187cb8 100644 --- a/src/basic/Matrix.js +++ b/src/basic/Matrix.js @@ -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; diff --git a/src/item/Item.js b/src/item/Item.js index a76b07f9..c0f7bee1 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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);