summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-11-12 11:50:24 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-11-12 12:57:01 (GMT)
commit344a4dcfe847dd778c33d1a852381672dd331409 (patch)
treee3c6757b9f9f3385602ccd17f9e179d769c2f31a /src/gui/text
parent7b3880475d02bd3db630387bccccc7e1ef9d4e9a (diff)
downloadQt-344a4dcfe847dd778c33d1a852381672dd331409.zip
Qt-344a4dcfe847dd778c33d1a852381672dd331409.tar.gz
Qt-344a4dcfe847dd778c33d1a852381672dd331409.tar.bz2
Fix text rendering offset for raster engine on Mac
Since the bounding box returned by Core Text in smaller than the actual glyph rendered, we have 2 pixels padding around it, as a result, we have to leave 1 pixel above the glyph in glyph cache, so we need to put the text origin 1 pixel lower to draw it. Task-number: QTBUG-15223, QTBUG-15230, QTBUG-15243 Reviewed-by: Gunnar Sletta
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontengine_mac.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_mac.mm b/src/gui/text/qfontengine_mac.mm
index 7efb1cc..51e18ec 100644
--- a/src/gui/text/qfontengine_mac.mm
+++ b/src/gui/text/qfontengine_mac.mm
@@ -694,7 +694,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetFont(ctx, cgFont);
qreal pos_x = -br.x.toReal() + subPixelPosition.toReal();
- qreal pos_y = im.height()+br.y.toReal();
+ qreal pos_y = im.height() + br.y.toReal() - 1;
CGContextSetTextPosition(ctx, pos_x, pos_y);
CGSize advance;