summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-07-14 09:40:12 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-14 11:21:55 +0200
commit042cffd601fd5b7e9ef176531893337a917cf455 (patch)
treea567e11fa45a6737788be76d121ba90acee41473 /src/gui/text
parentb2a8832a10b8b57aaff0e92fc31a2f6326a4822d (diff)
Apply 57993ba7 properly to 4.8
Because we have moved alignLine from qtextlayout.cpp to QTextEngine, this patch has to be applied manually. Reviewed-by: TrustMe (cherry picked from commit 705416cdc8ee91ac88d80298dbe2971a9384c196) Change-Id: Ibd657a52da1c510c839623738d49602b5c4a0824 Reviewed-on: http://codereview.qt.nokia.com/1640 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 5cb0bfea80..176393da08 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -2790,7 +2790,7 @@ QFixed QTextEngine::alignLine(const QScriptLine &line)
if (align & Qt::AlignRight)
x = line.width - (line.textAdvance + leadingSpaceWidth(line));
else if (align & Qt::AlignHCenter)
- x = (line.width - (line.textAdvance + leadingSpaceWidth(line)))/2;
+ x = (line.width - line.textAdvance)/2 - leadingSpaceWidth(line);
}
return x;
}