Tk Source Code

Check-in [10319218]
Login

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

Overview
Comment:fix test failure
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 103192184f0a76866a6d26db5f1e4fddbf94b247
User & Date: dkf 2012-06-11 13:06:34
Context
2012-06-12
08:29
Fix text clipping when working with the Xft-based renderer. check-in: 2c72a417 user: dkf tags: core-8-5-branch
2012-06-11
13:07
fix test failure check-in: bd0a0ac3 user: dkf tags: trunk
13:06
fix test failure check-in: 10319218 user: dkf tags: core-8-5-branch
10:20
make it build check-in: 00b9436f user: dkf tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/ttk/ttkEntry.c.

1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
	    leftIndex = maxLeftIndex;
	}

	/* Compute layoutX and rightIndex.
	 * rightIndex is set to one past the last fully-visible character.
	 */
	Tk_CharBbox(textLayout, leftIndex, &leftX, NULL, NULL, NULL);
	rightIndex = Tk_PointToChar(textLayout, leftX + textarea.width, 0)+1;
	entryPtr->entry.layoutX = textarea.x - leftX;
    }

    TtkScrolled(entryPtr->entry.xscrollHandle,
	    leftIndex, rightIndex, entryPtr->entry.numChars);
}








|







1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
	    leftIndex = maxLeftIndex;
	}

	/* Compute layoutX and rightIndex.
	 * rightIndex is set to one past the last fully-visible character.
	 */
	Tk_CharBbox(textLayout, leftIndex, &leftX, NULL, NULL, NULL);
	rightIndex = Tk_PointToChar(textLayout, leftX + textarea.width, 0);
	entryPtr->entry.layoutX = textarea.x - leftX;
    }

    TtkScrolled(entryPtr->entry.xscrollHandle,
	    leftIndex, rightIndex, entryPtr->entry.numChars);
}

1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
 *	Redraws the contents of an entry window.
 */
static void EntryDisplay(void *clientData, Drawable d)
{
    Entry *entryPtr = clientData;
    Tk_Window tkwin = entryPtr->core.tkwin;
    int leftIndex = entryPtr->entry.xscroll.first,
	rightIndex = entryPtr->entry.xscroll.last,
	selFirst = entryPtr->entry.selectFirst,
	selLast = entryPtr->entry.selectLast;
    EntryStyleData es;
    GC gc;
    int showSelection, showCursor;
    Ttk_Box textarea;
    TkRegion clipRegion;







|







1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
 *	Redraws the contents of an entry window.
 */
static void EntryDisplay(void *clientData, Drawable d)
{
    Entry *entryPtr = clientData;
    Tk_Window tkwin = entryPtr->core.tkwin;
    int leftIndex = entryPtr->entry.xscroll.first,
	rightIndex = entryPtr->entry.xscroll.last + 1,
	selFirst = entryPtr->entry.selectFirst,
	selLast = entryPtr->entry.selectLast;
    EntryStyleData es;
    GC gc;
    int showSelection, showCursor;
    Ttk_Box textarea;
    TkRegion clipRegion;
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
	entryPtr->entry.layoutX, entryPtr->entry.layoutY,
	leftIndex, rightIndex);
    Tk_FreeGC(Tk_Display(tkwin), gc);

    /* Overwrite the selected portion (if any) in the -selectforeground color:
     */
    if (showSelection) {
      gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion);
	Tk_DrawTextLayout(
	    Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout,
	    entryPtr->entry.layoutX, entryPtr->entry.layoutY,
	    selFirst, selLast);
	Tk_FreeGC(Tk_Display(tkwin), gc);
    }
    TkDestroyRegion(clipRegion);







|







1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
	entryPtr->entry.layoutX, entryPtr->entry.layoutY,
	leftIndex, rightIndex);
    Tk_FreeGC(Tk_Display(tkwin), gc);

    /* Overwrite the selected portion (if any) in the -selectforeground color:
     */
    if (showSelection) {
	gc = EntryGetGC(entryPtr, es.selForegroundObj, clipRegion);
	Tk_DrawTextLayout(
	    Tk_Display(tkwin), d, gc, entryPtr->entry.textLayout,
	    entryPtr->entry.layoutX, entryPtr->entry.layoutY,
	    selFirst, selLast);
	Tk_FreeGC(Tk_Display(tkwin), gc);
    }
    TkDestroyRegion(clipRegion);