summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-rw-r--r--src/gui/text/qtextlayout.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 66341e186a..c6e5160edc 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1693,7 +1693,7 @@ static inline void addNextCluster(int &pos, int end, QScriptLine &line, int &gly
} while (pos < end && logClusters[pos] == glyphPosition);
do { // calculate the textWidth for the rest of the current cluster.
if (!glyphs.attributes[glyphPosition].dontPrint)
- line.textWidth += glyphs.advances_x[glyphPosition];
+ line.textWidth += glyphs.advances[glyphPosition];
++glyphPosition;
} while (glyphPosition < current.num_glyphs && !glyphs.attributes[glyphPosition].clusterStart);
@@ -1871,9 +1871,9 @@ void QTextLine::layout_helper(int maxGlyphs)
// and thus become invisible again.
//
if (line.length)
- lbh.softHyphenWidth = lbh.glyphs.advances_x[lbh.logClusters[lbh.currentPosition - 1]];
+ lbh.softHyphenWidth = lbh.glyphs.advances[lbh.logClusters[lbh.currentPosition - 1]];
else if (breakany)
- lbh.tmpData.textWidth += lbh.glyphs.advances_x[lbh.logClusters[lbh.currentPosition - 1]];
+ lbh.tmpData.textWidth += lbh.glyphs.advances[lbh.logClusters[lbh.currentPosition - 1]];
}
// The actual width of the text needs to take the right bearing into account. The
@@ -2249,14 +2249,12 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
if (relativeFrom != (iterator.itemStart - si.position) && !rtl) {
for (int i=itemGlyphsStart; i<glyphsStart; ++i) {
QFixed justification = QFixed::fromFixed(glyphLayout.justifications[i].space_18d6);
- pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(),
- glyphLayout.advances_y[i].toReal());
+ pos.rx() += (glyphLayout.advances[i] + justification).toReal();
}
} else if (relativeTo != (iterator.itemEnd - si.position - 1) && rtl) {
for (int i=itemGlyphsEnd; i>glyphsEnd; --i) {
QFixed justification = QFixed::fromFixed(glyphLayout.justifications[i].space_18d6);
- pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(),
- glyphLayout.advances_y[i].toReal());
+ pos.rx() += (glyphLayout.advances[i] + justification).toReal();
}
}
@@ -2295,10 +2293,8 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
glyphRuns.append(glyphRunWithInfo(multiFontEngine->engine(which),
subLayout, pos, subFlags, x, width));
- for (int i = 0; i < subLayout.numGlyphs; i++) {
- pos += QPointF(subLayout.advances_x[i].toReal(),
- subLayout.advances_y[i].toReal());
- }
+ for (int i = 0; i < subLayout.numGlyphs; ++i)
+ pos.rx() += subLayout.advances[i].toReal();
if (rtl)
end = start;