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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72630 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bacfad22
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.
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment