Tk Source Code

Check-in [dc8c1cc0]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix in TkTextSeeCmd().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA1: dc8c1cc0c4af9e066bfa5abd5361ba63d973f983
User & Date: gcramer 2017-07-20 09:24:42
Context
2017-07-27
11:38
Fix of very nasty graphical glitches, especially in combination with TkScrollWindow. check-in: d23a7278 user: gcramer tags: revised_text, tip-466
2017-07-20
09:24
Fix in TkTextSeeCmd(). check-in: dc8c1cc0 user: gcramer tags: revised_text, tip-466
2017-07-07
15:22
Hardending: a few assertions added. check-in: 2f81be65 user: gcramer tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextDisp.c.

10063
10064
10065
10066
10067
10068
10069


10070
10071
10072
10073
10074
10075
10076
    TkTextDispChunk *chunkPtr;
    unsigned byteCount;

    assert(xPtr);
    assert(yPtr);
    assert(widthPtr);
    assert(heightPtr);



    /*
     * Find the chunk within the display line that contains the desired
     * index. The chunks making the display line are skipped up to but not
     * including the one crossing indexPtr. Skipping is done based on
     * a byteCount offset possibly spanning several logical lines in case
     * they are elided.







>
>







10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
    TkTextDispChunk *chunkPtr;
    unsigned byteCount;

    assert(xPtr);
    assert(yPtr);
    assert(widthPtr);
    assert(heightPtr);
    assert(dlPtr);
    assert(TkTextIndexCompare(&dlPtr->index, indexPtr) <= 0);

    /*
     * Find the chunk within the display line that contains the desired
     * index. The chunks making the display line are skipped up to but not
     * including the one crossing indexPtr. Skipping is done based on
     * a byteCount offset possibly spanning several logical lines in case
     * they are elided.
10205
10206
10207
10208
10209
10210
10211
10212

10213
10214
10215
10216
10217
10218
10219
    }

    /*
     * Take into account that the desired index is past the visible text.
     * It's also possible that the widget is not yet mapped.
     */

    if (!(dlPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &index))) {

	return TCL_OK;
    }

    if (GetBbox(textPtr, dlPtr, &index, &x, &y, &width, &height, NULL, NULL)) {
        delta = x - dInfoPtr->curXPixelOffset;
        oneThird = lineWidth/3;
        if (delta < 0) {







|
>







10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
    }

    /*
     * Take into account that the desired index is past the visible text.
     * It's also possible that the widget is not yet mapped.
     */

    if (!(dlPtr = FindDLine(textPtr, dInfoPtr->dLinePtr, &index))
	    || TkTextIndexCompare(&dInfoPtr->dLinePtr->index, &index) > 0) {
	return TCL_OK;
    }

    if (GetBbox(textPtr, dlPtr, &index, &x, &y, &width, &height, NULL, NULL)) {
        delta = x - dInfoPtr->curXPixelOffset;
        oneThird = lineWidth/3;
        if (delta < 0) {