From f9346a3b7a9119f344e11eb853fb8b4a0d35d025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 2 Mar 2011 16:06:06 +0000 Subject: [PATCH] Simplify code by merging setTransform() / transform() call to one. --- src/basic/Matrix.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/basic/Matrix.js b/src/basic/Matrix.js index dc45951e..802711e5 100644 --- a/src/basic/Matrix.js +++ b/src/basic/Matrix.js @@ -458,17 +458,10 @@ var Matrix = Base.extend({ // Canvas contexts seem to use another orientation: The scaleX (m00) and // scaleY (m11) values need to be flipped to get correct behaviour e.g. // when using rotation or shearing. - if (reset) { - context.setTransform( - -this._m00, this._m01, this._m10, - -this._m11, this._m02, this._m12 - ); - } else { - context.transform( - -this._m00, this._m01, this._m10, - -this._m11, this._m02, this._m12 - ); - } + context[reset ? 'setTransform' : 'transform']( + -this._m00, this._m01, this._m10, + -this._m11, this._m02, this._m12 + ); }, statics: {