Tk Source Code

Check-in [08ec7aed]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

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

Overview
Comment:Bugfix [6e16952a49]: Issue (2) fixed, cursor will be visible even if -padx is zero.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256:08ec7aedf7c69cb0d8beacaeeecb6eb616ece6e641527fe4c9c9258f86f2b4f3
User & Date: gcramer 2018-10-30 12:45:03
References
2018-10-30
21:34 Ticket [6e16952a] revised_text insertion cursor and -padx issues status still Open with 3 other changes artifact: 24aae96c user: fvogel
Context
2018-10-30
13:51
Bugfix [6e16952a49]: Issue (1) fixed. check-in: 6523c540 user: gcramer tags: revised_text, tip-466
12:45
Bugfix [6e16952a49]: Issue (2) fixed, cursor will be visible even if -padx is zero. check-in: 08ec7aed user: gcramer tags: revised_text, tip-466
2018-10-26
12:16
Bugfix [6f99ae03c4]: In rare cases LayoutLogicalLine() may be called when display line is already out of date, for example when TextBlinkProc() is invoked. check-in: e7376829 user: gcramer tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextMark.c.

2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
....
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696

    assert(textPtr);
    assert(x);
    assert(y);
    assert(w);
    assert(h);

    cursorExtent = MIN(textPtr->padX, textPtr->insertWidth/2);
    TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index);

    if (!TkTextIndexBbox(textPtr, &index, false, x, y, w, h, &charWidth, &thisChar)) {
	int base, ix, iw;

	/*
	 * Testing whether the cursor is visible is not as trivial at it seems,
................................................................................
unsigned
TkTextGetCursorWidth(
    TkText *textPtr,		/* The current text widget. */
    int *x,			/* Shift x coordinate, can be NULL. */
    int *extent)		/* Extent of cursor to left side, can be NULL. */
{
    int width;
    int cursorExtent = MIN(textPtr->padX, textPtr->insertWidth/2);

    if (extent) {
	*extent = -cursorExtent;
    }

    if (textPtr->blockCursorType) {
	int ix, iy, ih;







|







 







|







2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
....
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696

    assert(textPtr);
    assert(x);
    assert(y);
    assert(w);
    assert(h);

    cursorExtent = MAX(1, MIN(textPtr->padX, textPtr->insertWidth/2));
    TkTextMarkSegToIndex(textPtr, textPtr->insertMarkPtr, &index);

    if (!TkTextIndexBbox(textPtr, &index, false, x, y, w, h, &charWidth, &thisChar)) {
	int base, ix, iw;

	/*
	 * Testing whether the cursor is visible is not as trivial at it seems,
................................................................................
unsigned
TkTextGetCursorWidth(
    TkText *textPtr,		/* The current text widget. */
    int *x,			/* Shift x coordinate, can be NULL. */
    int *extent)		/* Extent of cursor to left side, can be NULL. */
{
    int width;
    int cursorExtent = MAX(1, MIN(textPtr->padX, textPtr->insertWidth/2));

    if (extent) {
	*extent = -cursorExtent;
    }

    if (textPtr->blockCursorType) {
	int ix, iy, ih;