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.
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
8241582: Infinite animation does not start from the end when started with a negative rate #169
8241582: Infinite animation does not start from the end when started with a negative rate #169
Changes from all commits
41e72c5
9c3b173
83a1ff7
4a0b1b9
File filter...
Jump to…
kevinrushforthApr 22, 2020
Member
Why
/ 6
?nliskerApr 22, 2020
Author
Collaborator
This is a good question and I think I should have explained it in a comment because it also points to a mini-flaw. The short answer is that the 6 comes from the
TicksCalculation
class, which definesTICKS_PER_SECOND = 6000
andTICKS_PER_MILI = TICKS_PER_SECOND / 1000.0
which is 6.The test works as follows:
This is the "ticks from duration" calculation for jumping to the end (
Duration.INDEFINITE
), demonstrated by mathematical substitutions:Notice that we lose precision when multiplying
POSITIVE_INFINITY
.Then getting the current time calculates "duration from ticks":
So the division carries out normally (there's no
Long.POSITIVE_INFINITY
), but the multiplication does not.Maybe we shouldn't convert between the
double
-basedDuration
and thelong
ticks so much, but I think that this is somewhat negligible.My next patch is refactoring in preparation of the next, heavier, changes, so I will add this explanation on the test.