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>
This commit is contained in:
Jiang Jiang 2011-07-14 09:40:12 +02:00 committed by Qt by Nokia
parent b2a8832a10
commit 042cffd601

View File

@ -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;
}