Eliminate rounding from int-based animation blending.
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2007 02:32:52 +0000 (02:32 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2007 02:32:52 +0000 (02:32 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27284 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/page/AnimationController.cpp
WebCore/rendering/Length.h

index 09b2d8b..204df9b 100644 (file)
@@ -246,7 +246,7 @@ double ImplicitAnimation::progress() const
 
 static inline int blendFunc(int from, int to, double progress)
 {  
-    return lround(from + (to - from) * progress);
+    return int(from + (to - from) * progress);
 }
 
 static inline double blendFunc(double from, double to, double progress)
index 6bb023a..af30b2c 100644 (file)
@@ -161,9 +161,9 @@ namespace WebCore {
                 return Length(fromPercent + (fromPercent - toPercent) * progress, Percent);
             } 
                 
-            double fromValue = from.isZero() ? 0 : from.value();
-            double toValue = isZero() ? 0 : value();
-            return Length(fromValue + (fromValue - toValue) * progress, resultType);
+            int fromValue = from.isZero() ? 0 : from.value();
+            int toValue = isZero() ? 0 : value();
+            return Length(int(fromValue + (fromValue - toValue) * progress), resultType);
         }
         
     private: