mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-28 22:08:54 -04:00
Rearrange method sequence in basic types.
This commit is contained in:
parent
3f634f6420
commit
a0066b61c3
4 changed files with 120 additions and 114 deletions
|
@ -70,18 +70,6 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
throw new Error('Unsupported matrix parameters');
|
||||
},
|
||||
|
||||
_serialize: function(options) {
|
||||
return Base.serialize(this.getValues(), options);
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {Matrix} A copy of this transform.
|
||||
*/
|
||||
clone: function() {
|
||||
return Matrix.create(this._a, this._c, this._b, this._d,
|
||||
this._tx, this._ty);
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets this transform to the matrix specified by the 6 values.
|
||||
*
|
||||
|
@ -103,6 +91,40 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
return this;
|
||||
},
|
||||
|
||||
_serialize: function(options) {
|
||||
return Base.serialize(this.getValues(), options);
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {Matrix} A copy of this transform.
|
||||
*/
|
||||
clone: function() {
|
||||
return Matrix.create(this._a, this._c, this._b, this._d,
|
||||
this._tx, this._ty);
|
||||
},
|
||||
|
||||
/**
|
||||
* 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 mx && 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 {String} A string representation of this transform.
|
||||
*/
|
||||
toString: function() {
|
||||
var format = Format.number;
|
||||
return '[[' + [format(this._a), format(this._b),
|
||||
format(this._tx)].join(', ') + '], ['
|
||||
+ [format(this._c), format(this._d),
|
||||
format(this._ty)].join(', ') + ']]';
|
||||
},
|
||||
|
||||
/**
|
||||
* "Resets" the matrix by setting its values to the ones of the identity
|
||||
* matrix that results in no transformation.
|
||||
|
@ -255,28 +277,6 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* @return {String} A string representation of this transform.
|
||||
*/
|
||||
toString: function() {
|
||||
var format = Format.number;
|
||||
return '[[' + [format(this._a), format(this._b),
|
||||
format(this._tx)].join(', ') + '], ['
|
||||
+ [format(this._c), format(this._d),
|
||||
format(this._ty)].join(', ') + ']]';
|
||||
},
|
||||
|
||||
/**
|
||||
* 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 mx && 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…
Add table
Add a link
Reference in a new issue