summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@noemail.net>2004-10-28 15:18:37 (GMT)
committerpatthoyts <patthoyts@noemail.net>2004-10-28 15:18:37 (GMT)
commit3b4ef29a1b0572b889861fe5baf2f503b2cc3fbe (patch)
tree9eb9fa0bafb8c6670443036e4243062e53bd55a7 /unix
parentaf301d0ca41c524e10e4cf25c5e31e8e11866c9e (diff)
downloadtk-3b4ef29a1b0572b889861fe5baf2f503b2cc3fbe.zip
tk-3b4ef29a1b0572b889861fe5baf2f503b2cc3fbe.tar.gz
tk-3b4ef29a1b0572b889861fe5baf2f503b2cc3fbe.tar.bz2
* unix/tkUnixScale.c (DisplayHorizontalValue): Backport fix for
#220927 by Michael Schlenker to keep the labels within the window. FossilOrigin-Name: 89c638a7a962e269b03a6cf2fd9eec3ec024147d
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixScale.c8
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,