aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-03-25 00:03:31 +0100
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2016-03-25 00:03:31 +0100
commit3af6480ec315bbbd895e6b77e232661ac113c3ff (patch)
tree59a28a831fc0b42d33c86e4549c406857242b8c6 /src
parent000b071d04d67091c148cbe66e515e63b4b46986 (diff)
downloadsvg.js-3af6480ec315bbbd895e6b77e232661ac113c3ff.tar.gz
svg.js-3af6480ec315bbbd895e6b77e232661ac113c3ff.zip
fixed bug where loop wasnt correctly reversed if specified
Diffstat (limited to 'src')
-rw-r--r--src/fx.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fx.js b/src/fx.js
index 7514a40..2a2c363 100644
--- a/src/fx.js
+++ b/src/fx.js
@@ -12,6 +12,7 @@ SVG.Situation = SVG.invent({
create: function(o){
this.init = false
this.reversed = false
+ this.reversing = false
this.duration = o.duration
this.delay = o.delay
@@ -329,7 +330,7 @@ SVG.FX = SVG.invent({
// store current loop and total loops
this.current.loop = times || true
- if(reverse) return this.reverse()
+ if(reverse) this.last().reversing = true
return this
}
@@ -455,11 +456,6 @@ SVG.FX = SVG.invent({
// adds one property to the animations
, add: function(method, args, type){
- //if(this.situations.length){
- // this.situations[this.situations.length-1][type || 'animations'][method] = args
- //}else{
- // this.current[type || 'animations'][method] = args
- //}
this.last()[type || 'animations'][method] = args
setTimeout(function(){this.start()}.bind(this), 0)
return this
@@ -475,6 +471,10 @@ SVG.FX = SVG.invent({
if(!ignoreTime) this.pos = this.timeToPos(+new Date)
if(this.pos >= 1 && (this.current.loop === true || (typeof this.current.loop == 'number' && --this.current.loop))){
+
+ if(this.current.reversing){
+ this.current.reversed = !this.current.reversed
+ }
return this.seek(this.pos-1)
}