Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #473
The first interval lasted 1 second too long, since it would need f.ex. 2 elapsed seconds to be larger than a duration of 1 second.
This worked out fine for the rest of the parts, because the would start then be initialized with the extra time (1 second)
from : newElapsed - currentPartDuration * 1000
The fix is in the first commit
Also changed some names and comments.
The naming using prev confused me a bit, since it is actually the current, so i removed that prefix
Gifs
Bug: Here we see that the first part lasts 2 seconds (0:01 and 0:00), even though it should only last 1
This is fixed in pr-gif, (first and all parts are just 0:01. which seems weird, but 1-second intervals are weird)
One consequence of this pr is that we now never reach 0:00, and 0:01 is now the last second displayed for an interval.
Another consequence is that the first second of every interval (not just first as before), will be shown as the full duration.
F.ex. a 5:00 interval will go from (5:00 4:59 4:58...) instead of the old (4:59)
Current (bug)
PR (fix)