Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeline.finish() is not working #964

Closed
michAtEl opened this issue Feb 21, 2019 · 1 comment
Closed

timeline.finish() is not working #964

michAtEl opened this issue Feb 21, 2019 · 1 comment

Comments

@michAtEl
Copy link

michAtEl commented Feb 21, 2019

Bug report

Fiddle

Try this codepen:
https://codepen.io/michAtEl/pen/KJYBzP

Uncomment the last line (//timeline.finish()) and run it again. The blue box reaches the wrong position (if my understanding of the API of timeline is correct).

Explanation

Timeline.finish() calls Timeline.getEndTime(). getEndTime() only looks at the last Runner in timeline._runners to calculate the endtime. In my example, the last element in this array does not have the latest endtime; in my example, the first element in this array has the latest endtime.

How to fix

I think it could be enough to loop over all runners in getEndTime() and find the runner with the latest endtime.
As long as it is not fixed: I make sure that the runner with the latest endtime is in the last position.

@Fuzzyma
Copy link
Member

Fuzzyma commented Feb 21, 2019

Good catch. It also seems that getEndTime is not time critical so looping over all runners could be a fix.
However, getEndTime is also used in schedule and for that it has to work like it is atm. So a replica of the old method is needed

Fuzzyma added a commit that referenced this issue Apr 1, 2019
@Fuzzyma Fuzzyma closed this as completed Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants