summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-08 11:39:36 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-08 12:00:38 (GMT)
commitc5f3ea858679d07d753e29af87f04efadd7683e9 (patch)
tree0234f1e8342fd139fabc9498e2e7c5f80d414e3c /src/gui/painting
parent8b66982ec7b4b5d2071931c288973dce73dc9875 (diff)
downloadQt-c5f3ea858679d07d753e29af87f04efadd7683e9.zip
Qt-c5f3ea858679d07d753e29af87f04efadd7683e9.tar.gz
Qt-c5f3ea858679d07d753e29af87f04efadd7683e9.tar.bz2
Use truncate only for subpixel boundingBox x position
Since Lion, Core Text starts to return fractional values for x origin in the glyph bounding box. To get correct alignment we need to make it integer, it seems that round will cut certain pixels (x = 0.6 will be round to 1, then that glyph will be moved too much to the left in image glyph cache). Reverting 4297b85a appears to work fine on previous version of Mac OS X as well. This change will not affect Windows (DirectWrite) and FreeType font engines since they both return integer values for that. Reviewed-by: Eskil
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index abd0ed1..3973abd 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -198,7 +198,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
Coord c = { 0, 0, // will be filled in later
glyph_width,
glyph_height, // texture coords
- metrics.x.round().truncate(),
+ metrics.x.truncate(),
-metrics.y.truncate() }; // baseline for horizontal scripts
listItemCoordinates.insert(key, c);