summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixScale.c
diff options
context:
space:
mode:
authorpatthoyts <patthoyts@noemail.net>2004-10-28 15:06:13 (GMT)
committerpatthoyts <patthoyts@noemail.net>2004-10-28 15:06:13 (GMT)
commitf21fe8d64b6b6fc1992701b28a6056de58957ffd (patch)
tree4fc1f48a9a35834fee6f4f57915fa90a17067e3c /unix/tkUnixScale.c
parent6e6a88d3a7c70b863465bc74ff35bd30ca471af8 (diff)
downloadtk-f21fe8d64b6b6fc1992701b28a6056de58957ffd.zip
tk-f21fe8d64b6b6fc1992701b28a6056de58957ffd.tar.gz
tk-f21fe8d64b6b6fc1992701b28a6056de58957ffd.tar.bz2
* unix/tkUnixScale.c (DisplayHorizontalValue): Fix for #220927 by
Michael Schlenker to keep the labels within the window. FossilOrigin-Name: f30410b8e93601b1778101786d02de7bef8aa726
Diffstat (limited to 'unix/tkUnixScale.c')
-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..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,