summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixScrlbr.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2009-10-07 14:33:27 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2009-10-07 14:33:27 (GMT)
commitfd8eb7674fdce0f78d84575ffaa855da197abe8c (patch)
tree83fc8cd3fe38b073d09df57f7b82cdf53ff2967d /unix/tkUnixScrlbr.c
parentabba76b707739e5a8614f12f8d35ffda60329b1e (diff)
downloadtk-fd8eb7674fdce0f78d84575ffaa855da197abe8c.zip
tk-fd8eb7674fdce0f78d84575ffaa855da197abe8c.tar.gz
tk-fd8eb7674fdce0f78d84575ffaa855da197abe8c.tar.bz2
[Patch 2088597]: Stop scrollbars from getting too small at the end.
Diffstat (limited to 'unix/tkUnixScrlbr.c')
-rw-r--r--unix/tkUnixScrlbr.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/unix/tkUnixScrlbr.c b/unix/tkUnixScrlbr.c
index bf210e2..2ca0a2e 100644
--- a/unix/tkUnixScrlbr.c
+++ b/unix/tkUnixScrlbr.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkUnixScrlbr.c,v 1.7 2008/12/09 23:21:48 dkf Exp $
+ * RCS: @(#) $Id: tkUnixScrlbr.c,v 1.8 2009/10/07 14:33:27 dkf Exp $
*/
#include "tkInt.h"
@@ -305,14 +305,13 @@ TkpComputeScrollbarGeometry(
* grabbed with the mouse).
*/
- if (scrollPtr->sliderFirst > (fieldLength - 2*scrollPtr->borderWidth)) {
- scrollPtr->sliderFirst = fieldLength - 2*scrollPtr->borderWidth;
+ if (scrollPtr->sliderFirst > fieldLength - MIN_SLIDER_LENGTH) {
+ scrollPtr->sliderFirst = fieldLength - MIN_SLIDER_LENGTH;
}
if (scrollPtr->sliderFirst < 0) {
scrollPtr->sliderFirst = 0;
}
- if (scrollPtr->sliderLast < (scrollPtr->sliderFirst
- + MIN_SLIDER_LENGTH)) {
+ if (scrollPtr->sliderLast < scrollPtr->sliderFirst + MIN_SLIDER_LENGTH) {
scrollPtr->sliderLast = scrollPtr->sliderFirst + MIN_SLIDER_LENGTH;
}
if (scrollPtr->sliderLast > fieldLength) {