diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-11-25 11:16:12 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-11-25 20:41:12 +0000 |
commit | d06d7413d5ac22e2c0d65e3144e80da6c716f9f5 (patch) | |
tree | b83d20ea7f037ba09daa6ca5f36566f3e1cb0ca2 /src/gui/text | |
parent | 00db6dbc274c763ee75ebe74bec0a586826d3934 (diff) |
Fix QTextLine::cursorToX()
0e99f3c broke tst_qquicktextinput::horizontalAlignment_RightToLeft()
and tst_qquicktextedit::hAlign_RightToLeft(). This fix was proposed
by Konstantin.
Change-Id: I602b7301d415f266224ae2c1ffd81244e9565862
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextlayout.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index 5f570fea82..65650504ac 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2627,7 +2627,7 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const const QScriptLine &line = eng->lines[index]; bool lastLine = index >= eng->lines.size() - 1; - QFixed x = line.x; + QFixed x = line.x + eng->alignLine(line) - eng->leadingSpaceWidth(line); if (!eng->layoutData) eng->itemize(); @@ -2636,8 +2636,6 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const return x.toReal(); } - x += eng->alignLine(line) - eng->leadingSpaceWidth(line); - int lineEnd = line.from + line.length + line.trailingSpaces; int pos = qBound(line.from, *cursorPos, lineEnd); int itm; |