Make sure cursor position doesn't exceed line end
authorJiang Jiang <jiang.jiang@nokia.com>
Mon, 19 Sep 2011 11:20:13 +0000 (13:20 +0200)
committerJiang Jiang <jiang.jiang@nokia.com>
Mon, 19 Sep 2011 11:43:12 +0000 (13:43 +0200)
commitc750afe0e0f043389d30850070889946e4c6e8af
treeb4e43b5ba25974ff80d1c9f4e58b5598d6039f9f
parent67a1b5e50c1cc90e9c03d9f4cadc9912f6880e15
Make sure cursor position doesn't exceed line end

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
src/gui/text/qtextlayout.cpp