summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_s60.cpp
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2010-08-26 14:16:59 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2010-08-27 14:51:57 (GMT)
commit40b6c1dd9199ac5e0d6a1921b05c11e647d09dca (patch)
tree74925154b039df1df12207ef5661fdbabe96dd5c /src/gui/text/qfontengine_s60.cpp
parenta2fd1b5265b1c6e9b3d8e1a03ddb2675f5df748d (diff)
downloadQt-40b6c1dd9199ac5e0d6a1921b05c11e647d09dca.zip
Qt-40b6c1dd9199ac5e0d6a1921b05c11e647d09dca.tar.gz
Qt-40b6c1dd9199ac5e0d6a1921b05c11e647d09dca.tar.bz2
Correct last right bearing in boundingBox(glyphs)
Commit 07880542ecc479807c23c5646d263135240822ff introduced regression to QFontMetrics::boundingRect and QTextEngine::boundingBox on FT, XLFD and QPF font engine. Because on these platforms, rightBearing of the last glyphs is already removed from the width returned in glyph_metrics_t. Subtracting that rightBearing twice will cause the resulting boundingBox smaller than expected. This patch fix this by removing last right bearing accounting code from generic QTextEngine::boundingBox, instead, we put it into font engines that need them: QFontEngineWin, QCoreTextFontEngine, QFontEngineMac, QFontEngineS60 and QFontEngineQWS. So that the resulting width should be correct on all platforms without introducing any performance penalties. Task-number: QTBUG-6854, QTBUG-12950 Reviewed-by: Eskil
Diffstat (limited to 'src/gui/text/qfontengine_s60.cpp')
-rw-r--r--src/gui/text/qfontengine_s60.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_s60.cpp b/src/gui/text/qfontengine_s60.cpp
index 52a1fe7..2cc3f50 100644
--- a/src/gui/text/qfontengine_s60.cpp
+++ b/src/gui/text/qfontengine_s60.cpp
@@ -345,7 +345,7 @@ glyph_metrics_t QFontEngineS60::boundingBox(const QGlyphLayout &glyphs)
for (int i = 0; i < glyphs.numGlyphs; ++i)
w += glyphs.effectiveAdvance(i);
- return glyph_metrics_t(0, -ascent(), w, ascent()+descent()+1, w, 0);
+ return glyph_metrics_t(0, -ascent(), w - lastRightBearing(glyphs), ascent()+descent()+1, w, 0);
}
glyph_metrics_t QFontEngineS60::boundingBox_const(glyph_t glyph) const