summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-16 13:54:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2015-11-16 13:54:24 (GMT)
commit8ceb24069a5b81f1dc4d0c753d2b852e645a8b51 (patch)
tree773417367b87bc88800ed848ff0720a907d64c73 /generic/tkText.c
parentadfd2034f10e55137405c8515c9f1d390f4b8021 (diff)
parente93d2c976989ce8e9fa4feff3b9d226c38f9390a (diff)
downloadtk-8ceb24069a5b81f1dc4d0c753d2b852e645a8b51.zip
tk-8ceb24069a5b81f1dc4d0c753d2b852e645a8b51.tar.gz
tk-8ceb24069a5b81f1dc4d0c753d2b852e645a8b51.tar.bz2
Merge core-8-5-branch
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 36bb4d4..5c7f187 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -566,14 +566,6 @@ CreateWidget(
textPtr->end = NULL;
}
- /*
- * Register with the B-tree. In some sense it would be best if we could do
- * this later (after configuration options), so that any changes to
- * start,end do not require a total recalculation.
- */
-
- TkBTreeAddClient(sharedPtr->tree, textPtr, textPtr->charHeight);
-
textPtr->state = TK_TEXT_STATE_NORMAL;
textPtr->relief = TK_RELIEF_FLAT;
textPtr->cursor = None;
@@ -584,6 +576,14 @@ CreateWidget(
textPtr->prevHeight = Tk_Height(newWin);
/*
+ * Register with the B-tree. In some sense it would be best if we could do
+ * this later (after configuration options), so that any changes to
+ * start,end do not require a total recalculation.
+ */
+
+ TkBTreeAddClient(sharedPtr->tree, textPtr, textPtr->charHeight);
+
+ /*
* This will add refCounts to textPtr.
*/
@@ -2342,6 +2342,7 @@ TextWorldChanged(
{
Tk_FontMetrics fm;
int border;
+ int oldCharHeight = textPtr->charHeight;
textPtr->charWidth = Tk_TextWidth(textPtr->tkfont, "0", 1);
if (textPtr->charWidth <= 0) {
@@ -2353,6 +2354,9 @@ TextWorldChanged(
if (textPtr->charHeight <= 0) {
textPtr->charHeight = 1;
}
+ if (textPtr->charHeight != oldCharHeight) {
+ TkBTreeClientRangeChanged(textPtr, textPtr->charHeight);
+ }
border = textPtr->borderWidth + textPtr->highlightWidth;
Tk_GeometryRequest(textPtr->tkwin,
textPtr->width * textPtr->charWidth + 2*textPtr->padX + 2*border,