Skip to content

Commit 0b17cd3

Browse files
crisbetojelbourn
authored andcommitted
fix(progress-circle): correct elapsed time calculation (#927)
Fixes the progress circle animation not working, because the calculations weren't correct. When 14c1765 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.
1 parent 199404b commit 0b17cd3

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/progress-circle/progress-circle.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,8 @@ export class MdProgressCircle implements OnDestroy {
158158
if (animateTo === animateFrom) {
159159
this.currentPath = getSvgArc(animateTo, rotation);
160160
} else {
161-
let animation = (currentTime: number) => {
162-
let elapsedTime = Math.max(
163-
0, Math.min((currentTime || Date.now()) - startTime, duration));
161+
let animation = () => {
162+
let elapsedTime = Math.max(0, Math.min(Date.now() - startTime, duration));
164163

165164
this.currentPath = getSvgArc(
166165
ease(elapsedTime, animateFrom, changeInValue, duration),

0 commit comments

Comments
 (0)