From 0b17cd311337ae60134bbfdc456db06bf505f6d3 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 4 Aug 2016 05:42:26 +0300 Subject: [PATCH] fix(progress-circle): correct elapsed time calculation (#927) Fixes the progress circle animation not working, because the calculations weren't correct. When 14c1765af4e0859e903baf9b8388ba114f8e9535 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. --- src/components/progress-circle/progress-circle.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/progress-circle/progress-circle.ts b/src/components/progress-circle/progress-circle.ts index 1d92a78d1ea..5daa83ec473 100644 --- a/src/components/progress-circle/progress-circle.ts +++ b/src/components/progress-circle/progress-circle.ts @@ -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),