Title: [112492] trunk/Source/WebCore
Revision
112492
Author
[email protected]
Date
2012-03-28 19:11:40 -0700 (Wed, 28 Mar 2012)

Log Message

Fix rounding in RenderInline::paintOutlineForLine
https://bugs.webkit.org/show_bug.cgi?id=82540

Reviewed by Eric Seidel.

No new tests, no change in functionality.

* rendering/RenderInline.cpp:
(WebCore::RenderInline::paintOutlineForLine):
Change paintOutlineForLine to pixel snap the left and right edges of the
lines instead of adding the offset to an already rounded number.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (112491 => 112492)


--- trunk/Source/WebCore/ChangeLog	2012-03-29 01:50:06 UTC (rev 112491)
+++ trunk/Source/WebCore/ChangeLog	2012-03-29 02:11:40 UTC (rev 112492)
@@ -1,3 +1,17 @@
+2012-03-28  Emil A Eklund  <[email protected]>
+
+        Fix rounding in RenderInline::paintOutlineForLine
+        https://bugs.webkit.org/show_bug.cgi?id=82540
+
+        Reviewed by Eric Seidel.
+
+        No new tests, no change in functionality.
+
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::paintOutlineForLine):
+        Change paintOutlineForLine to pixel snap the left and right edges of the
+        lines instead of adding the offset to an already rounded number.
+
 2012-03-28  David Grogan  <[email protected]>
 
         IndexedDB: don't expose IDBDatabaseError to script

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (112491 => 112492)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2012-03-29 01:50:06 UTC (rev 112491)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2012-03-29 02:11:40 UTC (rev 112492)
@@ -1465,6 +1465,8 @@
         LayoutSize(thisline.width() + offset, thisline.height() + offset));
 
     IntRect pixelSnappedBox = pixelSnappedIntRect(box);
+    IntRect pixelSnappedLastLine = pixelSnappedIntRect(paintOffset.x() + lastline.x(), 0, lastline.width(), 0);
+    IntRect pixelSnappedNextLine = pixelSnappedIntRect(paintOffset.x() + nextline.x(), 0, nextline.width(), 0);
     
     // left edge
     drawLineForBoxSide(graphicsContext,
@@ -1494,7 +1496,7 @@
         drawLineForBoxSide(graphicsContext,
             pixelSnappedBox.x() - outlineWidth,
             pixelSnappedBox.y() - outlineWidth,
-            min(pixelSnappedBox.maxX() + outlineWidth, (lastline.isEmpty() ? 1000000 : paintOffset.x() + lastline.x())),
+            min(pixelSnappedBox.maxX() + outlineWidth, (lastline.isEmpty() ? 1000000 : pixelSnappedLastLine.x())),
             pixelSnappedBox.y(),
             BSTop, outlineColor, outlineStyle,
             outlineWidth,
@@ -1503,7 +1505,7 @@
     
     if (lastline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
-            max(lastline.isEmpty() ? -1000000 : paintOffset.x() + lastline.maxX(), pixelSnappedBox.x() - outlineWidth),
+            max(lastline.isEmpty() ? -1000000 : pixelSnappedLastLine.maxX(), pixelSnappedBox.x() - outlineWidth),
             pixelSnappedBox.y() - outlineWidth,
             pixelSnappedBox.maxX() + outlineWidth,
             pixelSnappedBox.y(),
@@ -1527,7 +1529,7 @@
         drawLineForBoxSide(graphicsContext,
             pixelSnappedBox.x() - outlineWidth,
             pixelSnappedBox.maxY(),
-            min(pixelSnappedBox.maxX() + outlineWidth, !nextline.isEmpty() ? paintOffset.x() + nextline.x() + 1 : 1000000),
+            min(pixelSnappedBox.maxX() + outlineWidth, !nextline.isEmpty() ? pixelSnappedNextLine.x() + 1 : 1000000),
             pixelSnappedBox.maxY() + outlineWidth,
             BSBottom, outlineColor, outlineStyle,
             outlineWidth,
@@ -1536,7 +1538,7 @@
     
     if (nextline.maxX() < thisline.maxX())
         drawLineForBoxSide(graphicsContext,
-            max(!nextline.isEmpty() ? paintOffset.x() + nextline.maxX() : -1000000, pixelSnappedBox.x() - outlineWidth),
+            max(!nextline.isEmpty() ? pixelSnappedNextLine.maxX() : -1000000, pixelSnappedBox.x() - outlineWidth),
             pixelSnappedBox.maxY(),
             pixelSnappedBox.maxX() + outlineWidth,
             pixelSnappedBox.maxY() + outlineWidth,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to