summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2015-11-17 15:20:13 (GMT)
committerfvogel <fvogelnew1@free.fr>2015-11-17 15:20:13 (GMT)
commit3f3a9160c939098aa881f1b2429f23f883750a87 (patch)
tree000ca740c28bdd6e10b3eedd72555abc9599eaec /generic
parenteaad06dfab9f12af40967edfef6a9a5348af92f2 (diff)
downloadtk-3f3a9160c939098aa881f1b2429f23f883750a87.zip
tk-3f3a9160c939098aa881f1b2429f23f883750a87.tar.gz
tk-3f3a9160c939098aa881f1b2429f23f883750a87.tar.bz2
Fixed bug [1997299fff] - Tag borderwidth is leaking horizontally
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 6036222..7cf996f 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -2540,7 +2540,7 @@ DisplayLineBackground(
* current x coordinate? */
int matchRight; /* Does line's style match its neighbor just
* to the right of the current x-coord? */
- int minX, maxX, xOffset;
+ int minX, maxX, xOffset, bw;
StyleValues *sValuePtr;
Display *display;
#ifndef TK_NO_DOUBLE_BUFFERING
@@ -2611,16 +2611,25 @@ DisplayLineBackground(
rightX = leftX + 32767;
}
+ /*
+ * Prevent the borders from leaking on adjacent characters,
+ * which would happen for too large border width.
+ */
+
+ bw = sValuePtr->borderWidth;
+ if (leftX + sValuePtr->borderWidth > rightX) {
+ bw = rightX - leftX;
+ }
+
XFillRectangle(display, pixmap, chunkPtr->stylePtr->bgGC,
leftX + xOffset, y, (unsigned int) (rightX - leftX),
(unsigned int) dlPtr->height);
if (sValuePtr->relief != TK_RELIEF_FLAT) {
Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
- leftX + xOffset, y, sValuePtr->borderWidth,
- dlPtr->height, 1, sValuePtr->relief);
+ leftX + xOffset, y, bw, dlPtr->height, 1,
+ sValuePtr->relief);
Tk_3DVerticalBevel(textPtr->tkwin, pixmap, sValuePtr->border,
- rightX - sValuePtr->borderWidth + xOffset,
- y, sValuePtr->borderWidth, dlPtr->height, 0,
+ rightX - bw + xOffset, y, bw, dlPtr->height, 0,
sValuePtr->relief);
}
}