summaryrefslogtreecommitdiff
path: root/src/Fl_Input_.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Input_.cxx')
-rw-r--r--src/Fl_Input_.cxx14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 28c551039..6791b4b36 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Input_.cxx,v 1.21.2.1 1999/10/15 09:01:44 bill Exp $"
+// "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $"
//
// Common input widget routines for the Fast Light Tool Kit (FLTK).
//
@@ -352,7 +352,7 @@ void Fl_Input_::handle_mouse(int X, int Y,
p = e;
if (e >= value_+size_) break;
}
- const char *l, *r, *t; double f0 = 0;
+ const char *l, *r, *t; double f0 = Fl::event_x()-X+xscroll_;
for (l = p, r = e; l<r; ) {
double f;
t = l+(r-l+1)/2;
@@ -387,6 +387,14 @@ void Fl_Input_::handle_mouse(int X, int Y,
while (!wordboundary(newpos)) newpos--;
}
}
+ // if the multiple click does not increase the selection, revert
+ // to single-click behavior:
+ if (!drag && (mark() > position() ?
+ (newmark >= position() && newpos <= mark()) :
+ (newmark >= mark() && newpos <= position()))) {
+ Fl::event_clicks(0);
+ newmark = newpos = l-value();
+ }
}
position(newpos, newmark);
}
@@ -737,5 +745,5 @@ Fl_Input_::~Fl_Input_() {
}
//
-// End of "$Id: Fl_Input_.cxx,v 1.21.2.1 1999/10/15 09:01:44 bill Exp $".
+// End of "$Id: Fl_Input_.cxx,v 1.21.2.2 1999/10/30 20:21:30 bill Exp $".
//