summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkTextDisp.c2
-rw-r--r--unix/tkUnixFont.c5
-rw-r--r--win/tkWinFont.c6
3 files changed, 10 insertions, 3 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 2171cd0..1be26c4 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -7819,7 +7819,7 @@ CharChunkMeasureChars(
MeasureChars(tkfont, chars, charsLen, 0, bstart,
0, -1, 0, &widthUntilStart);
- xDisplacement = startX - widthUntilStart - chunkPtr->x;
+ xDisplacement = startX - widthUntilStart - ciPtr->baseChunkPtr->x;
}
fit = MeasureChars(tkfont, chars, charsLen, 0, bend,
diff --git a/unix/tkUnixFont.c b/unix/tkUnixFont.c
index 4a466f1..0c663a3 100644
--- a/unix/tkUnixFont.c
+++ b/unix/tkUnixFont.c
@@ -1414,10 +1414,13 @@ TkpDrawCharsInContext(
* whole (not just the range) string when
* drawing. */
{
+ int widthUntilStart;
+
(void) numBytes; /*unused*/
+ Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
- rangeLength, x, y);
+ rangeLength, x+widthUntilStart, y);
}
/*
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 47c4c3c..860451b 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -1407,9 +1407,13 @@ TkpDrawCharsInContext(
* whole (not just the range) string when
* drawing. */
{
+ int widthUntilStart;
+
(void) numBytes; /*unused*/
+
+ Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
- rangeLength, x, y);
+ rangeLength, x+widthUntilStart, y);
}
/*