[Qt] Poor rounding in GraphicsContext::drawLineForText
authorallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2013 13:51:24 +0000 (13:51 +0000)
committerallan.jensen@digia.com <allan.jensen@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Mar 2013 13:51:24 +0000 (13:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=113301

Reviewed by Jocelyn Turcotte.

Round the position of the line decoration, so lines on subpixel
coordinates are not always rounded up.

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

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

index 26095b4..b4c3299 100644 (file)
@@ -1,3 +1,16 @@
+2013-03-26  Allan Sandfeld Jensen  <allan.jensen@digia.com>
+
+        [Qt] Poor rounding in GraphicsContext::drawLineForText
+        https://bugs.webkit.org/show_bug.cgi?id=113301
+
+        Reviewed by Jocelyn Turcotte.
+
+        Round the position of the line decoration, so lines on subpixel
+        coordinates are not always rounded up.
+
+        * platform/graphics/qt/GraphicsContextQt.cpp:
+        (WebCore::GraphicsContext::drawLineForText):
+
 2013-03-26  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Decorations in several consecutive lines are not moved correctly in DTE.
index 984fe69..9a71455 100644 (file)
@@ -1033,8 +1033,7 @@ void GraphicsContext::drawLineForText(const FloatPoint& origin, float width, boo
     }
 #endif // defined(Q_WS_X11)
 
-    // FIXME: Loss of precision here. Might consider rounding.
-    drawLine(IntPoint(startPoint.x(), startPoint.y()), IntPoint(endPoint.x(), endPoint.y()));
+    drawLine(roundedIntPoint(startPoint), roundedIntPoint(endPoint));
 }