diff options
author | Saivan <savian@me.com> | 2018-07-04 00:44:46 +1000 |
---|---|---|
committer | Saivan <savian@me.com> | 2018-07-04 00:44:46 +1000 |
commit | 4688ab0d651547cb018c8f00590ddb18de40c6a1 (patch) | |
tree | 97b0287e3cccd76b4f881e616646b793bd1008a8 /src/helpers.js | |
parent | 5a1be483befaa644fd996b7be74ef59655160f95 (diff) | |
download | svg.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.js | 18 |
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) |