summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-04-23 00:20:35 (GMT)
committerhobbs <hobbs>2002-04-23 00:20:35 (GMT)
commite2e0d8545161567ae0678b10c3b6e3e7625a7319 (patch)
treea856643118d026c2171547c749e53a064fe45f1a /generic
parent03279a3d911d5a9be16777815f6f224c38aafdd5 (diff)
downloadtk-e2e0d8545161567ae0678b10c3b6e3e7625a7319.zip
tk-e2e0d8545161567ae0678b10c3b6e3e7625a7319.tar.gz
tk-e2e0d8545161567ae0678b10c3b6e3e7625a7319.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 'generic')
-rw-r--r--generic/tkTextDisp.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 2a3cf44..ac1d8d2 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkTextDisp.c,v 1.10 2002/04/22 12:45:49 dkf Exp $
+ * RCS: @(#) $Id: tkTextDisp.c,v 1.11 2002/04/23 00:20:35 hobbs Exp $
*/
#include "tkPort.h"
@@ -1890,6 +1890,25 @@ DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap)
rightX = maxX;
}
if (chunkPtr->stylePtr->bgGC != None) {
+ /* Not visible - bail out now */
+ if (rightX + xOffset <= 0) {
+ leftX = rightX;
+ continue;
+ }
+
+ /*
+ * Trim the start position for drawing to be no further away than
+ * -borderWidth. The reason is that on many X servers drawing from
+ * -32768 (or less) to +something simply does not display
+ * correctly. [Patch #541999]
+ */
+ if ((leftX + xOffset) < -(sValuePtr->borderWidth)) {
+ leftX = -sValuePtr->borderWidth - xOffset;
+ }
+ if ((rightX - leftX) > 32767) {
+ rightX = leftX + 32767;
+ }
+
XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC,
leftX + xOffset, 0, (unsigned int) (rightX - leftX),
(unsigned int) dlPtr->height);