From 32d0f31c31e57b13cd0d9d857a3688fff09a4f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Sun, 6 Mar 2011 21:05:24 +0000 Subject: [PATCH] Introduce Matrix.create() and use where applicable. --- src/basic/Matrix.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/basic/Matrix.js b/src/basic/Matrix.js index 99ff06ad..c12f3b7e 100644 --- a/src/basic/Matrix.js +++ b/src/basic/Matrix.js @@ -61,7 +61,7 @@ var Matrix = this.Matrix = Base.extend({ * @return {Matrix} A copy of this transform. */ clone: function() { - return new Matrix(this._m00, this._m10, this._m01, + return Matrix.create(this._m00, this._m10, this._m01, this._m11, this._m02, this._m12); }, @@ -410,7 +410,7 @@ var Matrix = this.Matrix = Base.extend({ var det = this.getDeterminant(); if (isFinite(det) && det != 0 && isFinite(this._m02) && isFinite(this._m12)) { - return new Matrix( + return Matrix.create( this._m11 / det, -this._m10 / det, -this._m01 / det, @@ -495,6 +495,11 @@ var Matrix = this.Matrix = Base.extend({ }, statics: { + // See Point.create() + create: function(m00, m10, m01, m11, m02, m12) { + return new Matrix(Matrix.dont).set(m00, m10, m01, m11, m02, m12); + }, + /** * Creates a transform representing a scaling transformation. *