From: Ulrich-Matthias Schäfer Date: Fri, 21 Sep 2018 09:40:08 +0000 (+0200) Subject: make sure runner[0] always exists (rework that requirement!) X-Git-Tag: 3.0.0~60^2~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca055e31f8d175d205b5dc96c73e9c42a8b3de86;p=svg.js.git make sure runner[0] always exists (rework that requirement!) --- diff --git a/src/runner.js b/src/runner.js index b69b1d6..2e55a1c 100644 --- a/src/runner.js +++ b/src/runner.js @@ -494,7 +494,7 @@ SVG.Runner.sanitise = function (duration, delay, when) { SVG.FakeRunner = class { - constructor (transforms, id = -1, done = true) { + constructor (transforms = new SVG.Matrix(), id = -1, done = true) { // Object.assign(this, {transforms, id, done}) this.transforms = transforms @@ -573,6 +573,8 @@ SVG.extend(SVG.Element, { delete arr[i] } }) + + this._transformationRunners[0] = new SVG.FakeRunner() }, addToCurrentTransform (transform) { @@ -682,7 +684,7 @@ SVG.extend(SVG.Runner, { } // Parse the parameters - var isMatrix = transforms.a != null + var isMatrix = isMatrixLike(transforms) affine = transforms.affine != null ? transforms.affine : (affine != null ? affine : !isMatrix)