Fix some bugs in the animation stuff

This commit is contained in:
Evert Timberg
2015-04-11 20:08:17 -04:00
parent 9a13dd78fc
commit 98253fea5d

View File

@@ -948,7 +948,7 @@
var stepDecimal = animationObject.currentStep / animationObject.numSteps;
var easeDecimal = easingFunction(stepDecimal);
chartInstance.draw(chartInstance, easeDecimal, stepDecimal, currentStep);
chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
};
// user events
@@ -2094,9 +2094,13 @@
// If there are no animations queued, manually kickstart a digest, for lack of a better word
if (this.animations.length) {
helpers.requestAnimFrame(this.startDigest);
helpers.requestAnimFrame.call(window, this.digestWrapper);
}
},
// calls startDigest with the proper context
digestWrapper: function() {
Chart.animationService.startDigest.call(Chart.animationService);
},
startDigest: function() {
for (var i = 0; i < this.animations.length; i++) {
@@ -2121,7 +2125,7 @@
// Do we have more stuff to animate?
if (this.animations.length > 0){
requestAnimationFrame(this.startDigest);
helpers.requestAnimFrame.call(window, this.digestWrapper);
}
}
};