fix(progress-circle): correct elapsed time calculation (#927)

Fixes the progress circle animation not working, because the calculations weren't correct. When 14c1765af4 was introduced, one of the values uses the time since epoch, whereas the other one is the time since the page was opened.

Fixes #926.
This commit is contained in:
Kristiyan Kostadinov
2016-08-04 05:42:26 +03:00
committed by Jeremy Elbourn
parent 199404b1cb
commit 0b17cd3113
@@ -158,9 +158,8 @@ export class MdProgressCircle implements OnDestroy {
if (animateTo === animateFrom) {
this.currentPath = getSvgArc(animateTo, rotation);
} else {
let animation = (currentTime: number) => {
let elapsedTime = Math.max(
0, Math.min((currentTime || Date.now()) - startTime, duration));
let animation = () => {
let elapsedTime = Math.max(0, Math.min(Date.now() - startTime, duration));
this.currentPath = getSvgArc(
ease(elapsedTime, animateFrom, changeInValue, duration),