summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-10-28 12:36:45 +0100
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2014-10-28 21:03:39 +0100
commit23553cccdaf42189fe2390f9b8082828fb1a5237 (patch)
tree75622a7d6f48900783f5130c8cdc1ff159239fdb
parentb1d3f1fec0d5c9f4f950f1d16ba25791fdcc8951 (diff)
Fix justification in multi fontengine glyphruns
QTextLine::glyphRuns was not handling justification when splitting glyphRuns due to multiple font-engines. This patch adds the missing justification. Task-number: QTBUG-41901 Change-Id: I02d24218630506da21531a6499784dff2eecdf6f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
-rw-r--r--src/gui/text/qtextlayout.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 911d1b8bc7..1ac50d3e5c 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2256,8 +2256,10 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
logClusters,
iterator.itemStart,
iterator.itemLength));
- for (int i = 0; i < subLayout.numGlyphs; ++i)
- pos.rx() += subLayout.advances[i].toReal();
+ for (int i = 0; i < subLayout.numGlyphs; ++i) {
+ QFixed justification = QFixed::fromFixed(subLayout.justifications[i].space_18d6);
+ pos.rx() += (subLayout.advances[i] + justification).toReal();
+ }
if (rtl)
end = start;