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

Unified Diff: Source/core/animation/AnimatableDouble.cpp

Issue 186463002: Web Animations: define distance for AnimatableColor (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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: Source/core/animation/AnimatableDouble.cpp
diff --git a/Source/core/animation/AnimatableDouble.cpp b/Source/core/animation/AnimatableDouble.cpp
index c49c3bd0cc471bd82856beac2731aabd4022af84..77d80f71ad2c6dd46a2342d50d1cd205d5431008 100644
--- a/Source/core/animation/AnimatableDouble.cpp
+++ b/Source/core/animation/AnimatableDouble.cpp
@@ -34,6 +34,7 @@
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSValuePool.h"
#include "platform/animation/AnimationUtilities.h"
+#include <math.h>
namespace WebCore {
@@ -74,4 +75,10 @@ bool AnimatableDouble::equalTo(const AnimatableValue* value) const
return m_number == toAnimatableDouble(value)->m_number;
}
+double AnimatableDouble::distanceTo(const AnimatableValue* value) const
+{
+ const AnimatableDouble* other = toAnimatableDouble(value);
+ return fabs(m_number - other->m_number);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698