From: Evert Timberg Date: Sun, 12 Apr 2015 00:08:17 +0000 (-0400) Subject: Fix some bugs in the animation stuff X-Git-Tag: v2.0-alpha~37^2~6^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98253fea5d0e2ecc1dcdad6321e5bf3137fd7ae2;p=thirdparty%2FChart.js.git Fix some bugs in the animation stuff --- diff --git a/src/Chart.Core.js b/src/Chart.Core.js index 85100573b..7e48ead00 100755 --- a/src/Chart.Core.js +++ b/src/Chart.Core.js @@ -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); } } };