]> source.dussan.org Git - svg.js.git/commitdiff
fix declaritive
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Tue, 29 May 2018 09:25:30 +0000 (11:25 +0200)
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>
Tue, 29 May 2018 09:25:30 +0000 (11:25 +0200)
src/controller.js
src/runner.js

index b2c7d134429bb9e31e2f94c6ae1df89fbb77a59b..359dc9f1161c2e3a01b736977d0be84b9df3c1f7 100644 (file)
@@ -120,8 +120,6 @@ SVG.Spring = SVG.invent ({
   extend: {
     step: function (current, target, dt, c) {
 
-console.log(current, target, dt);
-
       c.done = dt == Infinity
       if(dt == Infinity) return target
       if(dt == 0) return current
index 5edf44ab6ca2d554e37f7e70c06843e979fe599e..308705f416bbfe4dab00293fe09f647bc85fa20c 100644 (file)
@@ -17,6 +17,10 @@ SVG.Runner = SVG.invent({
       ? SVG.defaults.timeline.duration
       : options
 
+    options = typeof options !== 'object' || options instanceof SVG.Stepper
+      ? options
+      : options.duration
+
     // ensure that we get a controller
     options = typeof options === 'function'
       ? new SVG.Controller(options)
@@ -51,7 +55,7 @@ SVG.Runner = SVG.invent({
 
     animate: function (duration, delay, when) {
 
-      return new SVG.Runner(duration && duration.duration || duration)
+      return new SVG.Runner(duration)
         .element(this)
         .timeline(this.timeline())
         .init(duration, delay, when)
@@ -85,7 +89,7 @@ SVG.Runner = SVG.invent({
 
     loop: function (duration, times, swing) {
 
-      return new SVG.Runner(duration.duration || duration)
+      return new SVG.Runner(duration)
         .element(this)
         .timeline(this.timeline())
         .initLoop(duration, times, swing)
@@ -130,7 +134,7 @@ SVG.Runner = SVG.invent({
     },
 
     animate: function(duration, delay, when) {
-      var runner = new SVG.Runner(duration.duration || duration)
+      var runner = new SVG.Runner(duration)
       if(this._timeline) runner.element(this._timeline)
       if(this._element) runner.element(this._element)
       return runner.init(duration, delay, when)
@@ -203,7 +207,7 @@ SVG.Runner = SVG.invent({
     // FIXME: This definitely shouldn't make a new runner, this should just change
     // the looping behaviour of the current runner.
     loop: function (duration, times, swing) {
-      var runner = new SVG.Runner(duration.duration || duration)
+      var runner = new SVG.Runner(duration)
       if(this._timeline) runner.element(this._timeline)
       if(this._element) runner.element(this._element)
       return runner.initLoop(duration, times, swing)