summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogelnew1@free.fr <fvogel>2014-12-28 15:09:46 (GMT)
committerfvogelnew1@free.fr <fvogel>2014-12-28 15:09:46 (GMT)
commit1d292c6096d4fae7cc6862f404deb216384496ff (patch)
tree5cca05f25d7daf6b490583006db4a2bceb5369b9 /generic
parent3a1cf3e1c90ba8c371993ac3b7353e88b582e9ba (diff)
downloadtk-1d292c6096d4fae7cc6862f404deb216384496ff.zip
tk-1d292c6096d4fae7cc6862f404deb216384496ff.tar.gz
tk-1d292c6096d4fae7cc6862f404deb216384496ff.tar.bz2
Fixed Bad counting of the total number of vertical pixels in the text widget, resulting in small change of the Y scrollbar size. Happened because CalculateDisplayLineHeight expects an index at start of a display line, which was not always the case.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index f99ecd8..ae9c341 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -3711,6 +3711,20 @@ TkTextUpdateOneLine(
}
/*
+ * CalculateDisplayLineHeight _must_ be called (below) with an index at
+ * the beginning of a display line. Force this to happen. This is needed
+ * when TkTextUpdateOneLine is called with a line that is merged with its
+ * previous line: the number of merged logical lines in a display line is
+ * calculated correctly only when CalculateDisplayLineHeight receives
+ * an index at the beginning of a display line. In turn this causes the
+ * merged lines to receive their correct zero pixel height in
+ * TkBTreeAdjustPixelHeight.
+ */
+
+ TkTextFindDisplayLineEnd(textPtr, indexPtr, 0, NULL);
+ linePtr = indexPtr->linePtr;
+
+ /*
* Iterate through all display-lines corresponding to the single logical
* line 'linePtr' (and lines merged into this line due to eol elision),
* adding up the pixel height of each such display line as we go along.