aboutsummaryrefslogtreecommitdiff
path: root/generic/Text.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/Text.c')
-rw-r--r--generic/Text.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/Text.c b/generic/Text.c
index c81d1b7..891ab85 100644
--- a/generic/Text.c
+++ b/generic/Text.c
@@ -1557,7 +1557,11 @@ PointToChar(TextItem text,
n = Tk_MeasureChars(text->font, ti->start, (int) ti->num_bytes,
p.x + 2 - (int) ti->origin_x, TK_PARTIAL_OK,
&dummy);
+#ifdef PTK
+ byte_index = (ti->start + n - 1) - text->text;
+#else
byte_index = Tcl_UtfPrev(ti->start + n, ti->start) - text->text;
+#endif
break;
}
}