diff options
author | fvogel <fvogelnew1@free.fr> | 2015-11-17 15:20:13 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2015-11-17 15:20:13 (GMT) |
commit | e296dc18826c4b2fa6bb20cc87612478dde1f2f3 (patch) | |
tree | 000ca740c28bdd6e10b3eedd72555abc9599eaec /generic | |
parent | e93d2c976989ce8e9fa4feff3b9d226c38f9390a (diff) | |
download | tk-e296dc18826c4b2fa6bb20cc87612478dde1f2f3.zip tk-e296dc18826c4b2fa6bb20cc87612478dde1f2f3.tar.gz tk-e296dc18826c4b2fa6bb20cc87612478dde1f2f3.tar.bz2 |
Fixed bug [1997299fff] - Tag borderwidth is leaking horizontally
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkTextDisp.c | 19 |
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); } } |