Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2639)

Unified Diff: cc/animation/animation.cc

Issue 652813003: CC: Fix issue for animations with fill and iteration start specified (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/animation/animation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation.cc
diff --git a/cc/animation/animation.cc b/cc/animation/animation.cc
index 5fe5b8c030db52b90816ac50639c627842f9b888..5e4bc1e98ac2bae2c7a3adb441c22ed05cb6dfd4 100644
--- a/cc/animation/animation.cc
+++ b/cc/animation/animation.cc
@@ -192,10 +192,11 @@ double Animation::TrimTimeToCurrentIteration(
DCHECK_GE(iteration_start_, 0);
double active_time = ConvertToActiveTime(monotonic_time);
+ double start_offset = iteration_start_ * curve_->Duration();
- // Return 0 if we are before the start of the animation
+ // Return start offset if we are before the start of the animation
if (active_time < 0)
- return 0;
+ return start_offset;
// Always return zero if we have no iterations.
if (!iterations_)
@@ -207,7 +208,6 @@ double Animation::TrimTimeToCurrentIteration(
double repeated_duration = iterations_ * curve_->Duration();
double active_duration = repeated_duration / std::abs(playback_rate_);
- double start_offset = iteration_start_ * curve_->Duration();
// Check if we are past active duration
if (iterations_ > 0 && active_time >= active_duration)
« no previous file with comments | « no previous file | cc/animation/animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698