Skip to content

Commit

Permalink
fix(progress-circle): correct elapsed time calculation (#927)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto authored and jelbourn committed Aug 4, 2016
1 parent 199404b commit 0b17cd3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/progress-circle/progress-circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 0b17cd3

Please sign in to comment.