If we have trailing spaces at the end of a line, cursor will disappear
because the position we returned exceeds line end, thus the widget
border. By limiting it within line.width we can make sure it always
visible, which is more consistent to the behavior in common platforms.
Reviewed-by: Eskil
(cherry picked from commit
c750afe0e0f043389d30850070889946e4c6e8af)
Change-Id: Ifc60b718369639bbb6f5afb35c29a6eb0dccd219
Reviewed-on: http://codereview.qt-project.org/5458
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
x += eng->offsetInLigature(si, pos, end, glyph_pos);
}
+ if (eng->option.wrapMode() != QTextOption::NoWrap && x > line.width)
+ x = line.width;
+
*cursorPos = pos + si->position;
return x.toReal();
}