summaryrefslogtreecommitdiffstats
path: root/generic/tkTextDisp.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-12-30 22:20:00 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-12-30 22:20:00 (GMT)
commitaec9ede5b3da6947ff19211dab99b56bb5379305 (patch)
tree4a6958521807d8c72bbe8a5e25d32cc3630bef03 /generic/tkTextDisp.c
parent531e91677e137dc0d6109374daef5cc802bf7c7d (diff)
downloadtk-aec9ede5b3da6947ff19211dab99b56bb5379305.zip
tk-aec9ede5b3da6947ff19211dab99b56bb5379305.tar.gz
tk-aec9ede5b3da6947ff19211dab99b56bb5379305.tar.bz2
Do everything the other way round. Leave things how they were on OS X (revert [a076cf64] and [42e0339e]), and fix TkpDrawCharsInContext() on Win and Linux in case these platforms at some point of time decide to define TK_LAYOUT_WITH_BASE_CHUNKS and TK_DRAW_IN_CONTEXT to true
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r--generic/tkTextDisp.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index f07650f..4b7b0db 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -7933,6 +7933,7 @@ 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--;
@@ -7942,12 +7943,14 @@ CharDisplayProc(
}
TkpDrawCharsInContext(display, dst, stylePtr->fgGC, sValuePtr->tkfont,
- string, numBytes, start, len, offsetX,
+ string, numBytes, start, len,
+ ciPtr->baseChunkPtr->x + xDisplacement,
y + baseline - sValuePtr->offset);
if (sValuePtr->underline) {
TkUnderlineCharsInContext(display, dst, stylePtr->ulGC,
- sValuePtr->tkfont, string, numBytes, offsetX,
+ sValuePtr->tkfont, string, numBytes,
+ ciPtr->baseChunkPtr->x + xDisplacement,
y + baseline - sValuePtr->offset,
start, start+len);
}
@@ -7956,7 +7959,8 @@ CharDisplayProc(
Tk_GetFontMetrics(sValuePtr->tkfont, &fm);
TkUnderlineCharsInContext(display, dst, stylePtr->ovGC,
- sValuePtr->tkfont, string, numBytes, offsetX,
+ sValuePtr->tkfont, string, numBytes,
+ ciPtr->baseChunkPtr->x + xDisplacement,
y + baseline - sValuePtr->offset
- fm.descent - (fm.ascent * 3) / 10,
start, start+len);