Title: [106866] branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp
Revision
106866
Author
[email protected]
Date
2012-02-06 16:00:37 -0800 (Mon, 06 Feb 2012)

Log Message

Fix pixel snapping logic for FrameSets. This is for code correctness, but would never actually lead to incorrect renderings.

Modified Paths

Diff

Modified: branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp (106865 => 106866)


--- branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp	2012-02-06 23:44:33 UTC (rev 106865)
+++ branches/subpixellayout/Source/WebCore/rendering/RenderFrameSet.cpp	2012-02-07 00:00:37 UTC (rev 106866)
@@ -82,7 +82,8 @@
 
 void RenderFrameSet::paintColumnBorder(const PaintInfo& paintInfo, const LayoutRect& borderRect)
 {
-    if (!paintInfo.rect.intersects(pixelSnappedIntRect(borderRect)))
+    IntRect snappedBorderRect = pixelSnappedIntRect(borderRect);
+    if (!paintInfo.rect.intersects(snappedBorderRect))
         return;
         
     // FIXME: We should do something clever when borders from distinct framesets meet at a join.
@@ -90,13 +91,13 @@
     // Fill first.
     GraphicsContext* context = paintInfo.context;
     ColorSpace colorSpace = style()->colorSpace();
-    context->fillRect(borderRect, frameSet()->hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
+    context->fillRect(snappedBorderRect, frameSet()->hasBorderColor() ? style()->visitedDependentColor(CSSPropertyBorderLeftColor) : borderFillColor(), colorSpace);
     
     // Now stroke the edges but only if we have enough room to paint both edges with a little
     // bit of the fill color showing through.
-    if (borderRect.width() >= 3) {
-        context->fillRect(IntRect(roundedIntPoint(borderRect.location()), IntSize(1, height())), borderStartEdgeColor(), colorSpace);
-        context->fillRect(IntRect(IntPoint(borderRect.maxX() - 1, borderRect.y()), IntSize(1, height())), borderEndEdgeColor(), colorSpace);
+    if (snappedBorderRect.width() >= 3) {
+        context->fillRect(IntRect(snappedBorderRect.location(), IntSize(1, snappedBorderRect.height())), borderStartEdgeColor(), colorSpace);
+        context->fillRect(IntRect(IntPoint(snappedBorderRect.maxX() - 1, snappedBorderRect.y()), IntSize(1, snappedBorderRect.height())), borderEndEdgeColor(), colorSpace);
     }
 }
 
@@ -115,9 +116,9 @@
 
     // Now stroke the edges but only if we have enough room to paint both edges with a little
     // bit of the fill color showing through.
-    if (borderRect.height() >= 3) {
-        context->fillRect(IntRect(roundedIntPoint(borderRect.location()), IntSize(width(), 1)), borderStartEdgeColor(), colorSpace);
-        context->fillRect(IntRect(IntPoint(borderRect.x(), borderRect.maxY() - 1), IntSize(width(), 1)), borderEndEdgeColor(), colorSpace);
+    if (snappedBorderRect.height() >= 3) {
+        context->fillRect(IntRect(snappedBorderRect.location(), IntSize(width(), 1)), borderStartEdgeColor(), colorSpace);
+        context->fillRect(IntRect(IntPoint(snappedBorderRect.x(), snappedBorderRect.maxY() - 1), IntSize(snappedBorderRect.width(), 1)), borderEndEdgeColor(), colorSpace);
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to