Skip to content

Commit

Permalink
Merge pull request BabylonJS#912 from Temechon/master
Browse files Browse the repository at this point in the history
Fixed bug when an animation event was accessing new animated value
  • Loading branch information
RaananW committed Jan 15, 2016
2 parents 3c488a7 + 302a122 commit 399d1b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Animations/babylon.animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@
var currentFrame = returnValue ? from + ratio % range : to;
var currentValue = this._interpolate(currentFrame, repeatCount, this.loopMode, offsetValue, highLimitValue);

// Set value
this.setValue(currentValue);

// Check events
for (var index = 0; index < this._events.length; index++) {
if (currentFrame >= this._events[index].frame) {
Expand All @@ -472,9 +475,6 @@
}
}

// Set value
this.setValue(currentValue);

if (!returnValue) {
this._stopped = true;
}
Expand Down

0 comments on commit 399d1b8

Please sign in to comment.