diff options
author | fvogelnew1@free.fr <fvogel> | 2015-01-24 14:58:03 (GMT) |
---|---|---|
committer | fvogelnew1@free.fr <fvogel> | 2015-01-24 14:58:03 (GMT) |
commit | 43202bdf5b7678279ad57e69854c36c6a6e8c72d (patch) | |
tree | 756feba5ca87ddf98ea57401e90da2be2dbdd405 /generic/tkTextDisp.c | |
parent | 6e70d0c9924222b58ed4e45ca85bdc52104ed4e4 (diff) | |
download | tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.zip tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.tar.gz tk-43202bdf5b7678279ad57e69854c36c6a6e8c72d.tar.bz2 |
TkTextIndexCount is counting chars. Fix these calls where bytes counting is needed. Among other issues, this fixes horizontal scrolling when typing text at the end of a line containing multi-byte characters.
Diffstat (limited to 'generic/tkTextDisp.c')
-rw-r--r-- | generic/tkTextDisp.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index a6ab13c..34202bd 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -3465,8 +3465,8 @@ TkTextFindDisplayLineEnd( */ *xOffset = DlineXOfIndex(textPtr, dlPtr, - TkTextIndexCount(textPtr, &dlPtr->index, indexPtr, - COUNT_INDICES)); + TkTextIndexCountBytes(textPtr, &dlPtr->index, + indexPtr)); } if (end) { /* @@ -5549,8 +5549,7 @@ TkTextSeeCmd( * they are elided. */ - byteCount = TkTextIndexCount(textPtr, &dlPtr->index, &index, - COUNT_INDICES); + byteCount = TkTextIndexCountBytes(textPtr, &dlPtr->index, &index); for (chunkPtr = dlPtr->chunkPtr; chunkPtr != NULL ; chunkPtr = chunkPtr->nextPtr) { if (byteCount < chunkPtr->numBytes) { @@ -7078,8 +7077,7 @@ TkTextIndexBbox( * they are elided. */ - byteCount = TkTextIndexCount(textPtr, &dlPtr->index, indexPtr, - COUNT_INDICES); + byteCount = TkTextIndexCountBytes(textPtr, &dlPtr->index, indexPtr); for (chunkPtr = dlPtr->chunkPtr; ; chunkPtr = chunkPtr->nextPtr) { if (chunkPtr == NULL) { return -1; |