Index: Source/core/animation/NumberSVGInterpolation.cpp |
diff --git a/Source/core/animation/NumberSVGInterpolation.cpp b/Source/core/animation/NumberSVGInterpolation.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ee46a45fdf0dfd9d158292da8028c062bb604307 |
--- /dev/null |
+++ b/Source/core/animation/NumberSVGInterpolation.cpp |
@@ -0,0 +1,18 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "core/animation/NumberSVGInterpolation.h" |
+ |
+namespace blink { |
+ |
+PassRefPtrWillBeRawPtr<SVGNumber> NumberSVGInterpolation::fromInterpolableValue(const InterpolableValue& value, SVGNumberNegativeValuesMode negativeValuesMode) |
+{ |
+ double doubleValue = toInterpolableNumber(value).value(); |
+ if (negativeValuesMode == ForbidNegativeNumbers && doubleValue < 0) |
+ doubleValue = 0; |
+ return SVGNumber::create(doubleValue); |
+} |
+ |
+} |