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 |