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

Unified Diff: third_party/WebKit/Source/core/animation/InterpolationEffect.cpp

Issue 1942703002: Fix handling of multiple keyframes at same offset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review Created 4 years, 8 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
Index: third_party/WebKit/Source/core/animation/InterpolationEffect.cpp
diff --git a/third_party/WebKit/Source/core/animation/InterpolationEffect.cpp b/third_party/WebKit/Source/core/animation/InterpolationEffect.cpp
index 5a6b68843982e1a1d79bbda4c1f422738c388195..c6658cd1654c481b73d814847cff0b5f836d0b9f 100644
--- a/third_party/WebKit/Source/core/animation/InterpolationEffect.cpp
+++ b/third_party/WebKit/Source/core/animation/InterpolationEffect.cpp
@@ -14,7 +14,8 @@ void InterpolationEffect::getActiveInterpolations(double fraction, double iterat
for (const auto& record : m_interpolations) {
if (fraction >= record.m_applyFrom && fraction < record.m_applyTo) {
RefPtr<Interpolation> interpolation = record.m_interpolation;
- double localFraction = (fraction - record.m_start) / (record.m_end - record.m_start);
+ double recordLength = record.m_end - record.m_start;
+ double localFraction = recordLength ? (fraction - record.m_start) / recordLength : 0.0;
if (record.m_easing)
localFraction = record.m_easing->evaluate(localFraction, accuracyForDuration(iterationDuration));
interpolation->interpolate(0, localFraction);

Powered by Google App Engine
This is Rietveld 408576698