summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2016-12-23 22:16:42 (GMT)
committerfvogelnew1@free.fr <fvogel>2016-12-23 22:16:42 (GMT)
commite95afbb67440f5f2523dc9ea134774d866bb1d47 (patch)
treefa8f4b6b28640f10f11564134855eca0dfc1b71d
parentd17c9a982c771a469587e6c77c362b2eafc9d6ce (diff)
downloadtk-e95afbb67440f5f2523dc9ea134774d866bb1d47.zip
tk-e95afbb67440f5f2523dc9ea134774d866bb1d47.tar.gz
tk-e95afbb67440f5f2523dc9ea134774d866bb1d47.tar.bz2
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.
-rw-r--r--generic/tkTextDisp.c10
1 files 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);