RFR: 8236753: Animations do not play backwards after being stopped

Nir Lisker nlisker at openjdk.java.net
Thu Jan 16 01:06:49 UTC 2020

On Tue, 14 Jan 2020 16:50:12 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

>> I should add that it will depend on whether there are any regressions. One thing we do need to be careful of is introducing regressions during rampdown.
> The fix looks good to me.
> After this change the steps needed for playing an `Animation` backwards will change.
> Earlier this was documented with `Animation.play()` API as below.
> -------------
> To play an `Animation` backwards from the end:
> animation.setRate(negative rate);
> animation.jumpTo(overall duration of animation);
> animation.play();
> -------------
> After this PR call to `jumpTo()` won't be needed here.
> So this PR may need a document change for `Animation.play()`.
> Also to note that the behavior of above mentioned three calls remains same with the changes in this change.

> If cycleCount is set to 2 does the animation play the same number of times with or without the jumpTo both before and after this change?

Before the change:
* With `jumpTo`: plays backwards 2 times.
* Without `jumpTo`: doesn't play no mater how many times you call `play()`. Compare with the case where `cycleCount` is 1, in which case the first call does nothing (moves the playing head to the start) and the second one plays backwards.

After the change:
* With `jumpTo`: plays backwards 2 times.
* Without `jumpTo`: plays backwards 2 times.

> If the jumpTo isn't required, then this isn't this a change in behaviour?

Current code with `jumpTo` will behave the same. The question (which I presented initially) is whether this behavior is considered a bug or not when it comes to the initial state of an animation. It is certainly a bug when `stop()` is called, so I assume it is similar for the initial state.


PR: https://git.openjdk.java.net/jfx/pull/82

More information about the openjfx-dev mailing list