LayoutUnit::epsilon() is wrong
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jul 2012 22:41:33 +0000 (22:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Jul 2012 22:41:33 +0000 (22:41 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90083

Patch by Behdad Esfahbod <behdad@behdad.org> on 2012-07-02
Reviewed by Eric Seidel.

Do division in floats, not integers.

No new tests. No code using the affected function.

* platform/FractionalLayoutUnit.h:
(WebCore::FractionalLayoutUnit::epsilon):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121709 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/FractionalLayoutUnit.h

index 19e806a..d09bb75 100644 (file)
@@ -1,3 +1,17 @@
+2012-07-02  Behdad Esfahbod  <behdad@behdad.org>
+
+        LayoutUnit::epsilon() is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=90083
+
+        Reviewed by Eric Seidel.
+
+        Do division in floats, not integers.
+
+        No new tests. No code using the affected function.
+
+        * platform/FractionalLayoutUnit.h:
+        (WebCore::FractionalLayoutUnit::epsilon):
+
 2012-07-02  Tim Horton  <timothy_horton@apple.com>
 
         Compositing layer sync should cause deferred repaints to be fired immediately
index d201e12..7641a71 100644 (file)
@@ -153,7 +153,7 @@ public:
         return toInt();
     }
 
-    static float epsilon() { return 1 / kFixedPointDenominator; }
+    static float epsilon() { return 1.0f / kFixedPointDenominator; }
     static const FractionalLayoutUnit max()
     {
         FractionalLayoutUnit m;