Fix STR #2486: cursor position was wrong in some tab-containing wrapped lines.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8052 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2010-12-18 08:32:37 +00:00
parent b211421bc4
commit 15e1ddf3c9

View File

@ -358,6 +358,8 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
if (Fl::focus() == this && selstart == selend &&
position() >= p-value() && position() <= e-value()) {
fl_color(cursor_color());
// cursor position may need to be recomputed (see STR #2486)
curx = int(expandpos(p, value()+position(), buf, 0)+.5);
if (readonly()) {
fl_line((int)(xpos+curx-2.5f), Y+ypos+height-1,
(int)(xpos+curx+0.5f), Y+ypos+height-4,