mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
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),
|
||||
|
||||
Reference in New Issue
Block a user