Title: [125547] trunk/Source/WebCore
Revision
125547
Author
allan.jen...@nokia.com
Date
2012-08-14 04:47:30 -0700 (Tue, 14 Aug 2012)

Log Message

[Qt] Incomplete repaint of link underline
https://bugs.webkit.org/show_bug.cgi?id=66034

Reviewed by Kenneth Rohde Christiansen.

When trying to point a line of width 30, we end up painting on of width 31, because Qt
interprets the line as end-inclusive. So adjust for end-include/exclusive difference
before requesting the draw from Qt.

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::drawLine):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125546 => 125547)


--- trunk/Source/WebCore/ChangeLog	2012-08-14 11:46:56 UTC (rev 125546)
+++ trunk/Source/WebCore/ChangeLog	2012-08-14 11:47:30 UTC (rev 125547)
@@ -1,3 +1,17 @@
+2012-08-14  Allan Sandfeld Jensen  <allan.jen...@nokia.com>
+
+        [Qt] Incomplete repaint of link underline
+        https://bugs.webkit.org/show_bug.cgi?id=66034
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        When trying to point a line of width 30, we end up painting on of width 31, because Qt 
+        interprets the line as end-inclusive. So adjust for end-include/exclusive difference 
+        before requesting the draw from Qt.
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::drawLine):
+
 2012-08-14  Mike West  <mk...@chromium.org>
 
         Fix crash in http/tests/plugins/plugin-document-has-focus

Modified: trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp (125546 => 125547)


--- trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-08-14 11:46:56 UTC (rev 125546)
+++ trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp	2012-08-14 11:47:30 UTC (rev 125547)
@@ -461,7 +461,12 @@
         p->setPen(pen);
     }
 
-    p->drawLine(p1, p2);
+    // Qt interprets geometric units as end-point inclusive, while WebCore interprets geomtric units as endpoint exclusive.
+    // This means we need to subtract one from the endpoint, or the line will be painted one pixel too long.
+    if (p1.x() == p2.x())
+        p->drawLine(p1, p2 - FloatSize(0, 1));
+    else
+        p->drawLine(p1, p2 - FloatSize(1, 0));
 
     if (patWidth)
         p->restore();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to