diff options
author | fvogel <fvogelnew1@free.fr> | 2014-12-17 21:54:54 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2014-12-17 21:54:54 (GMT) |
commit | 9c98aee49acabd279f526bb618d14fc0567a1348 (patch) | |
tree | 2f253ce349dc8d6ab6494ebe720dc0642133ba4e | |
parent | 59b9a21b7c5259458517dc0a1fb1ecfe31dd4ddd (diff) | |
download | tk-9c98aee49acabd279f526bb618d14fc0567a1348.zip tk-9c98aee49acabd279f526bb618d14fc0567a1348.tar.gz tk-9c98aee49acabd279f526bb618d14fc0567a1348.tar.bz2 |
Fixed vertical scrolling with elided lines. MeasureUp was not measuring fully correctly.
-rw-r--r-- | generic/tkTextDisp.c | 2 | ||||
-rw-r--r-- | tests/textDisp.test | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/generic/tkTextDisp.c b/generic/tkTextDisp.c index e87b5e8..e318338 100644 --- a/generic/tkTextDisp.c +++ b/generic/tkTextDisp.c @@ -5328,6 +5328,8 @@ MeasureUp( index.linePtr = TkBTreeFindLine(srcPtr->tree, textPtr, lineNum); index.byteIndex = 0; + TkTextFindDisplayLineEnd(textPtr, &index, 0, NULL); + lineNum = TkBTreeLinesTo(textPtr, index.linePtr); lowestPtr = NULL; do { dlPtr = LayoutDLine(textPtr, &index); diff --git a/tests/textDisp.test b/tests/textDisp.test index b8db32c..ea2100c 100644 --- a/tests/textDisp.test +++ b/tests/textDisp.test @@ -2118,6 +2118,19 @@ test textDisp-16.43 {TkTextYviewCmd procedure with indices in elided lines} { update .t index @0,0 } {5.0} +test textDisp-16.44 {TkTextYviewCmd procedure, scroll down, with elided lines} { + .t configure -wrap none + .t delete 1.0 end + foreach x [list 0 1 2 3 4 5 6 7 8 9 0] { + .t insert end "$x aaa1\n$x bbb2\n$x ccc3\n$x ddd4\n$x eee5\n$x fff6" + .t insert end "$x 1111\n$x 2222\n$x 3333\n$x 4444\n$x 5555\n$x 6666" hidden + } + .t tag configure hidden -elide true ; # 5 hidden lines + update + .t see [expr {5 + [winfo height .t] / $fixedHeight} + 1].0 + update + .t index @0,0 +} {2.0} .t delete 1.0 end foreach i {a b c d e f g h i j k l m n o p q r s t u v w x y z} { |