summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanton <stanton>1998-10-21 22:12:43 (GMT)
committerstanton <stanton>1998-10-21 22:12:43 (GMT)
commit2790a2bf2787210fe61671bb2fd56545772b4fd5 (patch)
treee7b114e33baedca63ec8c814ff308ad576026227
parent7553ccb36638c5ec505e7f2ae261212ae61dd9ef (diff)
downloadtk-2790a2bf2787210fe61671bb2fd56545772b4fd5.zip
tk-2790a2bf2787210fe61671bb2fd56545772b4fd5.tar.gz
tk-2790a2bf2787210fe61671bb2fd56545772b4fd5.tar.bz2
Fixed bug 747: underlines don't map to character offsets in unicode strings
-rw-r--r--generic/tkFont.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c
index dfaa752..3a8d655 100644
--- a/generic/tkFont.c
+++ b/generic/tkFont.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkFont.c,v 1.1.4.2 1998/09/30 02:16:57 stanton Exp $
+ * RCS: @(#) $Id: tkFont.c,v 1.1.4.3 1998/10/21 22:12:43 stanton Exp $
*/
#include "tkPort.h"
@@ -1742,8 +1742,10 @@ Tk_UnderlineChars(display, drawable, gc, tkfont, string, x, y, firstChar,
fontPtr = (TkFont *) tkfont;
- Tk_MeasureChars(tkfont, string, firstChar, -1, 0, &startX);
- Tk_MeasureChars(tkfont, string, lastChar, -1, 0, &endX);
+ Tk_MeasureChars(tkfont, string,
+ (Tcl_UtfAtIndex(string, firstChar) - string), -1, 0, &startX);
+ Tk_MeasureChars(tkfont, string,
+ (Tcl_UtfAtIndex(string, lastChar) - string), -1, 0, &endX);
XFillRectangle(display, drawable, gc, x + startX,
y + fontPtr->underlinePos, (unsigned int) (endX - startX),