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

Unified Diff: cc/CCActiveAnimation.cpp

Issue 10961036: Gracefully handle zero duration curves in CCActiveAnimation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/CCActiveAnimationTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCActiveAnimation.cpp
diff --git a/cc/CCActiveAnimation.cpp b/cc/CCActiveAnimation.cpp
index f09209e1a7c71eb7ca89e4fa9524d2aeed21bc29..36c7c2b1583773539defba7a586bdd8c9c371b9d 100644
--- a/cc/CCActiveAnimation.cpp
+++ b/cc/CCActiveAnimation.cpp
@@ -154,6 +154,10 @@ double CCActiveAnimation::trimTimeToCurrentIteration(double monotonicTime) const
if (!m_iterations)
return 0;
+ // Don't attempt to trim if we have no duration.
+ if (m_curve->duration() <= 0)
+ return 0;
+
// If less than an iteration duration, just return trimmed.
if (trimmed < m_curve->duration())
return trimmed;
« no previous file with comments | « no previous file | cc/CCActiveAnimationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698