summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtextureglyphcache.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-11-17 12:25:49 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-11-17 12:39:11 (GMT)
commit4297b85a83408f86f2bd4df0f3b7bc98bf900fbe (patch)
treea2f484babcc30f55399211a1cd9dc045243a3fcc /src/gui/painting/qtextureglyphcache.cpp
parentecc202c0410125c944f156b5d0de67f093c02723 (diff)
downloadQt-4297b85a83408f86f2bd4df0f3b7bc98bf900fbe.zip
Qt-4297b85a83408f86f2bd4df0f3b7bc98bf900fbe.tar.gz
Qt-4297b85a83408f86f2bd4df0f3b7bc98bf900fbe.tar.bz2
Fix pixel alignment of glyphs when using raster engine on Mac Cocoa
The left bearing of the glyph has to be rounded before truncated, otherwise the subpixel positioning of the glyph will be lost. The visible consequence of this was on Mac Cocoa where certain pairs of glyphs would get an extra pixel of space between them when running with graphics system raster. With small fonts it would look pretty bad. Task-number: QTBUG-5430 Reviewed-by: Trond
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-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 a192e87..46fbaa9 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -101,7 +101,7 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti,
Coord c = { 0, 0, // will be filled in later
glyph_width,
glyph_height, // texture coords
- metrics.x.truncate(),
+ metrics.x.round().truncate(),
-metrics.y.truncate() }; // baseline for horizontal scripts
listItemCoordinates.insert(glyph, c);