summaryrefslogtreecommitdiffstats
path: root/src/helpers.js
diff options
context:
space:
mode:
authorSaivan <savian@me.com>2018-07-04 00:44:46 +1000
committerSaivan <savian@me.com>2018-07-04 00:44:46 +1000
commit4688ab0d651547cb018c8f00590ddb18de40c6a1 (patch)
tree97b0287e3cccd76b4f881e616646b793bd1008a8 /src/helpers.js
parent5a1be483befaa644fd996b7be74ef59655160f95 (diff)
downloadsvg.js-4688ab0d651547cb018c8f00590ddb18de40c6a1.tar.gz
svg.js-4688ab0d651547cb018c8f00590ddb18de40c6a1.zip
Worked towards setting the origin on each frame with linear algebra
This commit attempts to modify the origin on each frame, but it seems that we have some kind of bug that we need to fix first
Diffstat (limited to 'src/helpers.js')
-rw-r--r--src/helpers.js18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/helpers.js b/src/helpers.js
index 755beba..108fbfc 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -260,23 +260,6 @@ function formatTransforms (o) {
}
}
-/* TODO: KILL
-
-
- 1. Transform the origin by figuring out the delta
-
- - At the start, we had:
-
- let Sinv = new SVG.Matrix(element).inverse()
- let origin = getOrigin(element)
-
- - At a particular frame we have:
-
- let C = Matrix(element)
- let newOrigin = origin.transform(S.inv).transform(C)
-
-*/
-
function getOrigin (o, element) {
// Allow origin or around as the names
@@ -298,6 +281,7 @@ function getOrigin (o, element) {
: y + height / 2
// Find the new center in the transformed coordinates
+ console.log(element.attr('transform'))
const matrix = new SVG.Matrix(element)
const {x: tx , y: ty} = new SVG.Point(bx, by).transform(matrix)