summaryrefslogtreecommitdiffstats
path: root/unix/tkUnix3d.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-04-23 00:20:35 (GMT)
committerhobbs <hobbs>2002-04-23 00:20:35 (GMT)
commite299f884f26f88cb6551312a56335687b396e472 (patch)
treea856643118d026c2171547c749e53a064fe45f1a /unix/tkUnix3d.c
parent47fe3ad632f682b3d520e04b85fe7b5adc7cc018 (diff)
downloadtk-e299f884f26f88cb6551312a56335687b396e472.zip
tk-e299f884f26f88cb6551312a56335687b396e472.tar.gz
tk-e299f884f26f88cb6551312a56335687b396e472.tar.bz2
* generic/tkTextDisp.c (DisplayLineBackground):
* unix/tkUnix3d.c (Tk_3DHorizontalBevel): * unix/tkUnixFont.c (Tk_DrawChars): applied fixes to not overrun the X window 16-bit size limit. [Patch #541999] (bonfield)
Diffstat (limited to 'unix/tkUnix3d.c')
-rw-r--r--unix/tkUnix3d.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/unix/tkUnix3d.c b/unix/tkUnix3d.c
index 28331c5..838a14b 100644
--- a/unix/tkUnix3d.c
+++ b/unix/tkUnix3d.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: tkUnix3d.c,v 1.5 2000/04/14 01:36:35 ericm Exp $
+ * RCS: @(#) $Id: tkUnix3d.c,v 1.6 2002/04/23 00:20:35 hobbs Exp $
*/
#include <tk3d.h>
@@ -294,6 +294,15 @@ Tk_3DHorizontalBevel(tkwin, drawable, border, x, y, width, height,
for ( ; y < bottom; y++) {
/*
+ * X Dimensions are 16-bit, so avoid wraparound or display errors
+ * by limiting these here.
+ */
+ if (x1 < -32767)
+ x1 = -32767;
+ if (x2 > 32767)
+ x2 = 32767;
+
+ /*
* In some weird cases (such as large border widths for skinny
* rectangles) x1 can be >= x2. Don't draw the lines
* in these cases.