diff options
Diffstat (limited to 'src/gui/text/qtextlayout.cpp')
-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; |