[Cairo] Text extent of shadowed text is calculated incorrectly
[WebKit-https.git] / Source / WebCore / platform / graphics / cairo / FontCairo.cpp
index 35d1e5b..d6e43eb 100644 (file)
@@ -85,7 +85,8 @@ static void drawGlyphsShadow(GraphicsContext* graphicsContext, const FloatPoint&
 
     cairo_text_extents_t extents;
     cairo_scaled_font_glyph_extents(font->platformData().scaledFont(), glyphs, numGlyphs, &extents);
-    FloatRect fontExtentsRect(point.x(), point.y() - extents.height, extents.width, extents.height);
+    FloatRect fontExtentsRect(point.x() + extents.x_bearing, point.y() + extents.y_bearing, extents.width, extents.height);
+
     if (GraphicsContext* shadowContext = shadow.beginShadowLayer(graphicsContext, fontExtentsRect)) {
         drawGlyphsToContext(shadowContext->platformContext()->cr(), font, glyphs, numGlyphs);
         shadow.endShadowLayer(graphicsContext);