diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2004-10-28 15:18:37 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2004-10-28 15:18:37 (GMT) |
commit | 1bd6e15cae5109bb00ca55e58f6b97c8157c8050 (patch) | |
tree | 9eb9fa0bafb8c6670443036e4243062e53bd55a7 /unix | |
parent | 6eca1b073cf6f27c3170f72e1a416d6fe6cc8703 (diff) | |
download | tk-1bd6e15cae5109bb00ca55e58f6b97c8157c8050.zip tk-1bd6e15cae5109bb00ca55e58f6b97c8157c8050.tar.gz tk-1bd6e15cae5109bb00ca55e58f6b97c8157c8050.tar.bz2 |
* unix/tkUnixScale.c (DisplayHorizontalValue): Backport fix for
#220927 by Michael Schlenker to keep the labels within the window.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixScale.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c index f8d3313..abc983b 100644 --- a/unix/tkUnixScale.c +++ b/unix/tkUnixScale.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixScale.c,v 1.8 2001/09/21 21:34:10 hobbs Exp $ + * RCS: @(#) $Id: tkUnixScale.c,v 1.8.4.1 2004/10/28 15:18:40 patthoyts Exp $ */ #include "tkScale.h" @@ -500,7 +500,11 @@ DisplayHorizontalValue(scalePtr, drawable, value, top) if (x < (scalePtr->inset + SPACING)) { x = scalePtr->inset + SPACING; } - if (x > (Tk_Width(tkwin) - scalePtr->inset)) { + /* + * Check the right border so use starting point +text width + * for the check. + */ + if (x + width >= (Tk_Width(tkwin) - scalePtr->inset)) { x = Tk_Width(tkwin) - scalePtr->inset - SPACING - width; } Tk_DrawChars(scalePtr->display, drawable, scalePtr->textGC, |