summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_coretext.mm
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-06 17:08:41 +0200
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-07 09:22:13 +0200
commitba65e2741c47912a800132b90f7dbaf2551b04c4 (patch)
tree326ae278e9cb35e12bf424a37807657bc37e08fd /src/gui/text/qfontengine_coretext.mm
parentb2799a705b6d7655bb23ec4121fd76ce8a94b344 (diff)
Fix raster subpixel positioning in Lion
In Lion, the x position returned by CTFontGetBoundingRectsForGlyphs can be fractional, we need to round().truncate() it as we did in QTextureGlyphCache to save the baseLineX. Reviewed-by: Eskil
Diffstat (limited to 'src/gui/text/qfontengine_coretext.mm')
-rw-r--r--src/gui/text/qfontengine_coretext.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
index 07711a3b38..afeb0a0e51 100644
--- a/src/gui/text/qfontengine_coretext.mm
+++ b/src/gui/text/qfontengine_coretext.mm
@@ -750,7 +750,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetFont(ctx, cgFont);
- qreal pos_x = -br.x.toReal() + subPixelPosition.toReal() + margin;
+ qreal pos_x = -br.x.round().truncate() + subPixelPosition.toReal() + margin;
qreal pos_y = im.height() + br.y.toReal() - margin;
CGContextSetTextPosition(ctx, pos_x, pos_y);