diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-03-23 22:50:30 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2016-03-23 22:50:30 +0100 |
commit | 8205de6087bd6fe48706f598c49a111f52740c97 (patch) | |
tree | 965fd228f650007bd6ded8835885d89b2e19554b /src/matrix.js | |
parent | 2b26d66fc4686c249ef27b2b8ca1bb20df7bb95d (diff) | |
download | svg.js-8205de6087bd6fe48706f598c49a111f52740c97.tar.gz svg.js-8205de6087bd6fe48706f598c49a111f52740c97.zip |
Implementation new fx module
Diffstat (limited to 'src/matrix.js')
-rw-r--r-- | src/matrix.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/matrix.js b/src/matrix.js index 9b3c28e..e727b2f 100644 --- a/src/matrix.js +++ b/src/matrix.js @@ -14,7 +14,7 @@ SVG.Matrix = SVG.invent({ source : base // merge source - for (i = abcdef.length - 1; i >= 0; i--) + for (i = abcdef.length - 1; i >= 0; --i) this[abcdef[i]] = source && typeof source[abcdef[i]] === 'number' ? source[abcdef[i]] : base[abcdef[i]] } @@ -32,6 +32,8 @@ SVG.Matrix = SVG.invent({ // translation x: this.e , y: this.f + , transformedX:(this.e * Math.cos(skewX * Math.PI / 180) + this.f * Math.sin(skewX * Math.PI / 180)) / Math.sqrt(this.a * this.a + this.b * this.b) + , transformedY:(this.f * Math.cos(skewX * Math.PI / 180) + this.e * Math.sin(-skewX * Math.PI / 180)) / Math.sqrt(this.c * this.c + this.d * this.d) // skew , skewX: -skewX , skewY: 180 / Math.PI * Math.atan2(py.y, py.x) @@ -46,6 +48,7 @@ SVG.Matrix = SVG.invent({ , d: this.d , e: this.e , f: this.f + , matrix: new SVG.Matrix(this) } } // Clone matrix |