Implement Matrix#equals().

This commit is contained in:
Jürg Lehni 2011-11-26 12:04:44 +01:00
parent b51cf064b0
commit 907d6c0954

View file

@ -492,6 +492,17 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
? angle1 * 180 / Math.PI : undefined;
},
/**
* Checks whether the two matrices describe the same transformation.
*
* @param {Matrix} matrix the matrix to compare this matrix to
* @return {Boolean} {@true if the matrices are equal}
*/
equals: function(mx) {
return this._a == mx._a && this._b == mx._b && this._c == mx._c
&& this._d == mx._d && this._tx == mx._tx && this._ty == mx._ty;
},
/**
* @return {Boolean} Whether this transform is the identity transform
*/