summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@users.sourceforge.net>2004-10-28 15:06:14 (GMT)
committerpatthoyts <patthoyts@users.sourceforge.net>2004-10-28 15:06:14 (GMT)
commitc87342572e59fbdad7f99c32447e402ffcd5a270 (patch)
tree4fc1f48a9a35834fee6f4f57915fa90a17067e3c
parentb5e7e8747736a9f4f6e9c3ad6e1763b6a5900c9c (diff)
downloadtk-c87342572e59fbdad7f99c32447e402ffcd5a270.zip
tk-c87342572e59fbdad7f99c32447e402ffcd5a270.tar.gz
tk-c87342572e59fbdad7f99c32447e402ffcd5a270.tar.bz2
* unix/tkUnixScale.c (DisplayHorizontalValue): Fix for #220927 by
Michael Schlenker to keep the labels within the window.
-rw-r--r--ChangeLog5
-rw-r--r--unix/tkUnixScale.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 69903b8..cd21f7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-28 Pat Thoyts <patthoyts@users.sourceforge.net>
+
+ * unix/tkUnixScale.c (DisplayHorizontalValue): Fix for #220927 by
+ Michael Schlenker to keep the labels within the window.
+
2004-10-28 Donal K. Fellows <donal.k.fellows@man.ac.uk>
* doc/*.n: Assorted minor documentation fixes.
diff --git a/unix/tkUnixScale.c b/unix/tkUnixScale.c
index f8d3313..716a496 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.9 2004/10/28 15:06:27 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,