From a8b58dc223afc42c36a551ae6d6992e6bb02b2c7 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 7 Sep 2004 20:59:18 +0000 Subject: Documentation updates (STR #505, STR #513) The old source file "fl_set_gray.cxx" is not needed (STR #516) Fl_Text_Display still called delete[] instead of free() in one place (STR #503) Fl_File_Chooser didn't correctly call isprint() and isspace() when checking to see if the current file was text that can be previewed (STR #517) FLUID didn't compile with Borland C++ due to a compiler bug (STR #496) Fl_Positioner did not handle reversed min and max values (STR #510) fl_descent(), fl_height(), and fl_width() would crash a program if you didn't call fl_font() first; they now return -1 if no font is set (STR #500) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3805 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Positioner.cxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/Fl_Positioner.cxx') diff --git a/src/Fl_Positioner.cxx b/src/Fl_Positioner.cxx index 1c356ee2d..9eba88d56 100644 --- a/src/Fl_Positioner.cxx +++ b/src/Fl_Positioner.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.5 2004/07/27 16:02:21 easysw Exp $" +// "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.6 2004/09/07 20:59:17 easysw Exp $" // // Positioner widget for the Fast Light Tool Kit (FLTK). // @@ -81,12 +81,22 @@ int Fl_Positioner::handle(int event, int X, int Y, int W, int H) { double h1 = H - 2 * 4; double xx = flinear(Fl::event_x(), x1, x1+w1-1.0, xmin, xmax); if (xstep_) xx = int(xx/xstep_+0.5) * xstep_; - if (xx < xmin) xx = xmin; - if (xx > xmax) xx = xmax; + if (xmin < xmax) { + if (xx < xmin) xx = xmin; + if (xx > xmax) xx = xmax; + } else { + if (xx > xmin) xx = xmin; + if (xx < xmax) xx = xmax; + } double yy = flinear(Fl::event_y(), y1, y1+h1-1.0, ymin, ymax); if (ystep_) yy = int(yy/ystep_+0.5) * ystep_; - if (yy < ymin) yy = ymin; - if (yy > ymax) yy = ymax; + if (ymin < ymax) { + if (yy < ymin) yy = ymin; + if (yy > ymax) yy = ymax; + } else { + if (yy > ymin) yy = ymin; + if (yy < ymax) yy = ymax; + } if (value(xx, yy)) set_changed();} if (!(when() & FL_WHEN_CHANGED || (when() & FL_WHEN_RELEASE && event == FL_RELEASE))) return 1; @@ -131,5 +141,5 @@ void Fl_Positioner::ybounds(double a, double b) { } // -// End of "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.5 2004/07/27 16:02:21 easysw Exp $". +// End of "$Id: Fl_Positioner.cxx,v 1.4.2.3.2.6 2004/09/07 20:59:17 easysw Exp $". // -- cgit v1.2.3