aboutsummaryrefslogtreecommitdiffstats
path: root/src/runner.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-09-21 12:18:43 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-09-21 12:18:43 +0200
commit179187327810f9219437b371adada85b843f8b71 (patch)
treef1b6a36b83aa0aca2b7a1f3de4c8bd29371f5767 /src/runner.js
parentca055e31f8d175d205b5dc96c73e9c42a8b3de86 (diff)
downloadsvg.js-179187327810f9219437b371adada85b843f8b71.tar.gz
svg.js-179187327810f9219437b371adada85b843f8b71.zip
make sure, that we use the correct startTransform
Diffstat (limited to 'src/runner.js')
-rw-r--r--src/runner.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/runner.js b/src/runner.js
index 2e55a1c..4348aff 100644
--- a/src/runner.js
+++ b/src/runner.js
@@ -698,7 +698,7 @@ SVG.extend(SVG.Runner, {
let element
let current
let currentAngle
- let u = this.transformId++
+ let startTransform
function setup () {
@@ -706,6 +706,8 @@ SVG.extend(SVG.Runner, {
element = element || this.element()
origin = origin || getOrigin(transforms, element)
+ startTransform = new SVG.Matrix(relative ? undefined : element)
+
// add the runner to the element so it can merge transformations
element.addRunner(this)
@@ -724,11 +726,9 @@ SVG.extend(SVG.Runner, {
let {x, y} = new SVG.Point(origin).transform(element._currentTransform(this))
let target = new SVG.Matrix({...transforms, origin: [x, y]})
- let start = new SVG.Matrix(relative ? undefined : element)
-
- if (this._isDeclarative && current) {
- start = current
- }
+ let start = this._isDeclarative && current
+ ? current
+ : startTransform
if (affine) {
target = target.decompose(x, y)
@@ -760,12 +760,11 @@ SVG.extend(SVG.Runner, {
morpher.from(start)
morpher.to(target)
-
let affineParameters = morpher.at(pos)
currentAngle = affineParameters.rotate
current = new SVG.Matrix(affineParameters)
- this.addTransform(current, u)
+ this.addTransform(current)
return morpher.done()
}