summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r--src/gui/painting/qpainter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 898a996..596649e 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5977,12 +5977,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;
}
}