diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-05-19 13:31:25 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-05-19 13:31:25 (GMT) |
commit | 78dcac759d500c1744751955623b1d0babcd37a4 (patch) | |
tree | 59d7a2540c2fcffe0b274afbf85db9a1f53242f4 /src/gui/painting/qpainter.cpp | |
parent | f1c79b3c90c1e14d8bee0228e3e416fa5337cf6e (diff) | |
parent | de0858687898f6e0e54cce3f986779c7aa1a350e (diff) | |
download | Qt-78dcac759d500c1744751955623b1d0babcd37a4.zip Qt-78dcac759d500c1744751955623b1d0babcd37a4.tar.gz Qt-78dcac759d500c1744751955623b1d0babcd37a4.tar.bz2 |
Merge remote branch 'origin/4.7' into HEAD
Conflicts:
src/corelib/tools/qlocale_symbian.cpp
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index 853c65c..657229a 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -5976,12 +5976,17 @@ void QPainter::drawText(const QPointF &p, const QString &str, int tf, int justif gf.glyphs = engine.shapedGlyphs(&si); gf.chars = engine.layoutData->string.unicode() + si.position; gf.num_chars = engine.length(item); - gf.width = si.width; + if (engine.forceJustification) { + for (int j=0; j<gf.glyphs.numGlyphs; ++j) + gf.width += gf.glyphs.effectiveAdvance(j); + } else { + gf.width = si.width; + } gf.logClusters = engine.logClusters(&si); drawTextItem(QPointF(x.toReal(), p.y()), gf); - x += si.width; + x += gf.width; } } |