summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2014-12-07 18:50:46 (GMT)
committerfvogel <fvogelnew1@free.fr>2014-12-07 18:50:46 (GMT)
commit413213429639fc1c08af355008a85479b5d38739 (patch)
treeedea3d7e64db0f7b74403f011e18f42b7717596c /generic
parent0f4ee48cefc73a3759fe144f3427d4cda7560ffd (diff)
downloadtk-413213429639fc1c08af355008a85479b5d38739.zip
tk-413213429639fc1c08af355008a85479b5d38739.tar.gz
tk-413213429639fc1c08af355008a85479b5d38739.tar.bz2
Fixed text yview scroll pixels|lines with elided lines
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTextDisp.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c
index 8281411..6b6d305 100644
--- a/generic/tkTextDisp.c
+++ b/generic/tkTextDisp.c
@@ -5285,6 +5285,18 @@ MeasureUp(
distance -= dlPtr->height;
if (distance <= 0) {
*dstPtr = dlPtr->index;
+
+ /*
+ * Adjust index to the start of the display line. This is
+ * needed because the start of a logical line is not always
+ * the start of a display line (this is however true if the
+ * eol is not elided).
+ */
+
+ if (TkTextIsElided(textPtr, dstPtr, NULL)) {
+ TkTextFindDisplayLineEnd(textPtr, dstPtr, 0,
+ NULL);
+ }
if (overlap != NULL) {
*overlap = -distance;
}
@@ -5677,6 +5689,18 @@ YScrollByLines(
offset++;
if (offset == 0) {
textPtr->topIndex = dlPtr->index;
+
+ /*
+ * Adjust index to the start of the display line. This is
+ * needed because the start of a logical line is not
+ * always the start of a display line (this is however
+ * true if the eol is not elided).
+ */
+
+ if (TkTextIsElided(textPtr, &textPtr->topIndex, NULL)) {
+ TkTextFindDisplayLineEnd(textPtr, &textPtr->topIndex, 0,
+ NULL);
+ }
break;
}
}