summaryrefslogtreecommitdiffstats
path: root/src/matrix.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-03-24 23:44:59 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-03-24 23:44:59 +0100
commit000b071d04d67091c148cbe66e515e63b4b46986 (patch)
tree433bc79e68b00e06d2c1657b9a0b48e24248b944 /src/matrix.js
parent595777968f56ebafc8ab0b25d8605ce258f87c98 (diff)
parentc33e7f6c5b6cd2e4ef595fce65559eb74b8c5e63 (diff)
downloadsvg.js-000b071d04d67091c148cbe66e515e63b4b46986.tar.gz
svg.js-000b071d04d67091c148cbe66e515e63b4b46986.zip
Merge branch '3.0.0' introducing several changes:
- textpath now is a parent element, the lines method of text will return the tspans inside the textpath (#450) - fx module rewritten to support animation chaining and several other stuff (see docs when commited) - fixed absolute transformation animations (not perfect but better) - fixed event listeners which didnt work correctly when identic funtions used - added `element.is()` which helps to check for the object instance faster (instanceof check) - added more fx specs
Diffstat (limited to 'src/matrix.js')
-rw-r--r--src/matrix.js5
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