summaryrefslogtreecommitdiff
path: root/src/Fl_Input_.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2010-12-18 08:32:37 +0000
committerManolo Gouy <Manolo>2010-12-18 08:32:37 +0000
commit15e1ddf3c9c0ea6e24b331c848e4e40c8cb6ca35 (patch)
tree3e9d5985a9e081bfa281d7c731cbbcf9c97e2ddd /src/Fl_Input_.cxx
parentb211421bc4c9934618ec7e5ab4e2c16167b79e1f (diff)
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
Diffstat (limited to 'src/Fl_Input_.cxx')
-rw-r--r--src/Fl_Input_.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 03f8a974b..a0438356c 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -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,