From 179187327810f9219437b371adada85b843f8b71 Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Fri, 21 Sep 2018 12:18:43 +0200 Subject: make sure, that we use the correct startTransform --- src/runner.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/runner.js') 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() } -- cgit v1.2.3