]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix some bugs in the animation stuff
authorEvert Timberg <evert.timberg@gmail.com>
Sun, 12 Apr 2015 00:08:17 +0000 (20:08 -0400)
committerEvert Timberg <evert.timberg@gmail.com>
Sun, 12 Apr 2015 00:08:17 +0000 (20:08 -0400)
src/Chart.Core.js

index 85100573be76fce7c877b16eaed82f04871cea12..7e48ead008be01bb60164306de25360f0b271552 100755 (executable)
                                        var stepDecimal = animationObject.currentStep / animationObject.numSteps;
                                        var easeDecimal = easingFunction(stepDecimal);
                                        
-                                       chartInstance.draw(chartInstance, easeDecimal, stepDecimal, currentStep);
+                                       chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);
                                };
                                
                                // user events
 
                        // 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++) {
 
                        // Do we have more stuff to animate?
                        if (this.animations.length > 0){
-                               requestAnimationFrame(this.startDigest);
+                               helpers.requestAnimFrame.call(window, this.digestWrapper);
                        }
                }
        };