mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-05 07:54:04 +01:00
Fix some bugs in the animation stuff
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user