2010-11-23 Andreas Kling <kling@webkit.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Nov 2010 22:51:43 +0000 (22:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Nov 2010 22:51:43 +0000 (22:51 +0000)
        Reviewed by Tor Arne Vestbø.

        [Qt] Selecting shadowed text causes rendering artifacts
        https://bugs.webkit.org/show_bug.cgi?id=49990

        When selecting text starting from the end of a word, we need to use
        the X coordinate of the start of the substring when calculating the
        bounding rect for a ContextShadow.

        * platform/graphics/qt/FontQt.cpp:
        (WebCore::drawTextCommon):

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

WebCore/ChangeLog
WebCore/platform/graphics/qt/FontQt.cpp

index 4592c5a..c51d168 100644 (file)
@@ -1,3 +1,17 @@
+2010-11-23  Andreas Kling  <kling@webkit.org>
+
+        Reviewed by Tor Arne Vestbø.
+
+        [Qt] Selecting shadowed text causes rendering artifacts
+        https://bugs.webkit.org/show_bug.cgi?id=49990
+
+        When selecting text starting from the end of a word, we need to use
+        the X coordinate of the start of the substring when calculating the
+        bounding rect for a ContextShadow.
+
+        * platform/graphics/qt/FontQt.cpp:
+        (WebCore::drawTextCommon):
+
 2010-11-23  Chris Guillory  <chris.guillory@google.com>
 
         Reviewed by Dimitri Glazkov.
index c0acc7c..356edfa 100644 (file)
@@ -198,7 +198,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
                 p->restore();
             } else {
                 QFontMetrics fm(font);
-                QRectF boundingRect(point.x(), point.y() - fm.ascent(), fm.width(string), fm.height());
+                QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string), fm.height());
                 QPainter* shadowPainter = ctxShadow->beginShadowLayer(p, boundingRect);
                 if (shadowPainter) {
                     // Since it will be blurred anyway, we don't care about render hints.
@@ -215,7 +215,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
                 p->translate(-ctxShadow->offset());
             } else {
                 QFontMetrics fm(font);
-                QRectF boundingRect(point.x(), point.y() - fm.ascent(), fm.width(string), fm.height());
+                QRectF boundingRect(pt.x(), point.y() - fm.ascent(), fm.width(string), fm.height());
                 QPainter* shadowPainter = ctxShadow->beginShadowLayer(p, boundingRect);
                 if (shadowPainter) {
                     // Since it will be blurred anyway, we don't care about render hints.