Use a temporary in Animation::Tick()

This commit is contained in:
wolfbeast 2018-05-15 14:06:42 +02:00 • committed by Roy Tam
commit 685ae236c8

View file

@ -589,8 +589,10 @@ Animation::Tick()
// during the *previous* tick of the refresh driver, it can still be // during the *previous* tick of the refresh driver, it can still be
// ahead of the *current* timeline time when we are using the // ahead of the *current* timeline time when we are using the
// vsync timer so we need to clamp it to the timeline time. // vsync timer so we need to clamp it to the timeline time.
mPendingReadyTime.SetValue(std::min(mTimeline->GetCurrentTime().Value(), TimeDuration currentTime = mTimeline->GetCurrentTime().Value();
mPendingReadyTime.Value())); if (currentTime < mPendingReadyTime.Value()) {
mPendingReadyTime.SetValue(currentTime);
}
FinishPendingAt(mPendingReadyTime.Value()); FinishPendingAt(mPendingReadyTime.Value());
mPendingReadyTime.SetNull(); mPendingReadyTime.SetNull();
} }