mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Implement Matrix#equals().
This commit is contained in:
parent
b51cf064b0
commit
907d6c0954
1 changed files with 11 additions and 0 deletions
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue