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.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index b8be991fa1..c269eb2afd 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2710,8 +2710,8 @@ qreal QTextLine::cursorToX(int *cursorPos, Edge edge) const
x += eng->offsetInLigature(si, pos, end, glyph_pos);
}
- if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.width)
- x = line.width;
+ if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.x + line.width)
+ x = line.x + line.width;
if (eng->option.wrapMode() != QTextOption::NoWrap && x < 0)
x = 0;