Skip to content
Permalink
Browse files

8236753: Animations do not play backwards after being stopped

Reviewed-by: kcr, arapte
  • Loading branch information
Nir Lisker
Nir Lisker committed Jan 22, 2020
1 parent 16cea41 commit 9ae37f1fa7f3599d6e9314293be1d45ddc61bac5
@@ -256,7 +256,7 @@ private void set(T value) {
/* Package-private for testing purposes */
ClipEnvelope clipEnvelope;

private boolean lastPlayedFinished = false;
private boolean lastPlayedFinished = true;

private boolean lastPlayedForward = true;
/**
@@ -978,6 +978,7 @@ public void stop() {
clipEnvelope.abortCurrentPulse();
doStop();
jumpTo(Duration.ZERO);
lastPlayedFinished = true;
}
}

@@ -322,10 +322,19 @@ public void testPlay() {
assertFalse(listener.wasCalled);
assertFalse(timer.containsPulseReceiver(animation.shim_pulseReceiver()));
animation.stop();
animation.setRate(1.0);

// stopped timeline, rate = -1
listener.wasCalled = false;
animation.setRate(-1.0);
animation.play();
assertEquals(ONE_SEC.toMillis(), animation.getCurrentTime().toMillis(), EPSILON);
assertFalse(listener.wasCalled);
assertTrue(timer.containsPulseReceiver(animation.shim_pulseReceiver()));
animation.stop();

// stopped timeline, cycleDuration = 0
listener.wasCalled = false;
animation.setRate(1.0);
animation.shim_setCycleDuration(Duration.ZERO);
animation.play();
assertEquals(Status.STOPPED, animation.getStatus());
@@ -637,10 +637,10 @@ public void testCycleReverse() {
st.play();

assertEquals(Status.RUNNING, st.getStatus());
assertEquals(Status.RUNNING, child1X.getStatus());
assertEquals(Status.STOPPED, child1Y.getStatus());
assertEquals(0, xProperty.get());
assertEquals(0, yProperty.get());
assertEquals(Status.STOPPED, child1X.getStatus());
assertEquals(Status.RUNNING, child1Y.getStatus());
assertEquals(60000, xProperty.get());
assertTrue(0 < yProperty.get() && yProperty.get() < 10000);

st.jumpTo(TickCalculation.toDuration(100));

0 comments on commit 9ae37f1

Please sign in to comment.
You can’t perform that action at this time.