From 0316d840d0dd2798e1e345dd5a565c3c83ccbae3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Fri, 23 Dec 2016 22:16:42 +0000 Subject: On Windows with TK_LAYOUT_WITH_BASE_CHUNKS and TK_DRAW_IN_CONTEXT being both defined for testing purposes, rendering of the text was incorrect because some chunks were superimposed (this was only a display issue, x and width of all chunks were already correct). Fix this. --- generic/tkTextDisp.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index 4b7b0db..f07650f 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -7933,7 +7933,6 @@ CharDisplayProc( #if TK_DRAW_IN_CONTEXT int start = ciPtr->baseOffset + offsetBytes; int len = ciPtr->numBytes - offsetBytes; - int xDisplacement = x - chunkPtr->x; if ((len > 0) && (string[start + len - 1] == '\t')) { len--; @@ -7943,14 +7942,12 @@ CharDisplayProc( } TkpDrawCharsInContext(display, dst, stylePtr->fgGC, sValuePtr->tkfont, - string, numBytes, start, len, - ciPtr->baseChunkPtr->x + xDisplacement, + string, numBytes, start, len, offsetX, y + baseline - sValuePtr->offset); if (sValuePtr->underline) { TkUnderlineCharsInContext(display, dst, stylePtr->ulGC, - sValuePtr->tkfont, string, numBytes, - ciPtr->baseChunkPtr->x + xDisplacement, + sValuePtr->tkfont, string, numBytes, offsetX, y + baseline - sValuePtr->offset, start, start+len); } @@ -7959,8 +7956,7 @@ CharDisplayProc( Tk_GetFontMetrics(sValuePtr->tkfont, &fm); TkUnderlineCharsInContext(display, dst, stylePtr->ovGC, - sValuePtr->tkfont, string, numBytes, - ciPtr->baseChunkPtr->x + xDisplacement, + sValuePtr->tkfont, string, numBytes, offsetX, y + baseline - sValuePtr->offset - fm.descent - (fm.ascent * 3) / 10, start, start+len); -- cgit v0.12