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

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

Issue 811993002: Animation: Implement DoubleStyleInterpolation in StringKeyframe (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add length Prtoperty Created 5 years, 11 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/DoubleStyleInterpolation.cpp
diff --git a/Source/core/animation/DoubleStyleInterpolation.cpp b/Source/core/animation/DoubleStyleInterpolation.cpp
index 6f9cfe6434b5c425447218eaa405fa4719ba4b4e..5b102db2b51e3e33122bdb1684b25f8aaa60f075 100644
--- a/Source/core/animation/DoubleStyleInterpolation.cpp
+++ b/Source/core/animation/DoubleStyleInterpolation.cpp
@@ -22,9 +22,18 @@ PassRefPtrWillBeRawPtr<CSSValue> DoubleStyleInterpolation::interpolableValueToDo
{
ASSERT(value->isNumber());
double doubleValue = toInterpolableNumber(value)->value();
- if (clamp == ClampOpacity) {
- doubleValue = clampTo<float>(doubleValue, 0, nextafterf(1, 0));
- }
+ if (clamp == ClampOpacity)
Eric Willigers 2015/01/14 01:43:36 switch (clamp)
jadeg 2015/01/18 22:59:41 Done.
+ doubleValue = clampTo<float>(doubleValue, 0, nextafter(0.9999, 0));
+ if (clamp == ClampInteger)
+ doubleValue = floor(doubleValue);
+ if (clamp == ClampZoom)
+ doubleValue = clampTo<float>(doubleValue, 0.000000000000000000000000000000000000000000001);
+ if (clamp == ClampOrphans)
+ doubleValue = clampTo<int>((doubleValue + 0.5), 1);
+ if (clamp == ClampOne)
+ doubleValue = clampTo<float>(doubleValue, 1);
+ if (clamp == ClampZero)
+ doubleValue = clampTo<float>(doubleValue, 0);
return CSSPrimitiveValue::create(doubleValue, CSSPrimitiveValue::CSS_NUMBER);
}

Powered by Google App Engine
This is Rietveld 408576698