OSDN Git Service

Updated to tk 8.4.1
[pf3gnuchains/sourceware.git] / tk / unix / tkUnix3d.c
index 9cab150..b6a6b46 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <tk3d.h>
 
-#if !defined(__WIN32__) && !defined(MAC_TCL)
+#if !(defined(__WIN32__) || defined(MAC_TCL) || defined(MAC_OSX_TK))
 #include "tkUnixInt.h"
 #endif
 
@@ -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.
@@ -490,5 +499,3 @@ TkpGetShadows(borderPtr, tkwin)
        borderPtr->lightGC = Tk_GetGC(tkwin, GCForeground, &gcValues);
     }
 }
-
-