diff options
-rw-r--r-- | generic/tkFont.c | 4 | ||||
-rw-r--r-- | tests/entry.test | 13 | ||||
-rw-r--r-- | tests/font.test | 4 |
3 files changed, 17 insertions, 4 deletions
diff --git a/generic/tkFont.c b/generic/tkFont.c index 447f9e1..102fc6e 100644 --- a/generic/tkFont.c +++ b/generic/tkFont.c @@ -2067,14 +2067,14 @@ Tk_ComputeTextLayout( NewChunk(&layoutPtr, &maxChunks, start, 1, curX, newX, baseline)->numDisplayChars = -1; start++; + curX = newX; + flags &= ~TK_AT_LEAST_ONE; if ((start < end) && ((wrapLength <= 0) || (newX <= wrapLength))) { /* * More chars can still fit on this line. */ - curX = newX; - flags &= ~TK_AT_LEAST_ONE; continue; } } else { diff --git a/tests/entry.test b/tests/entry.test index 11408ac..f261f0d 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -1892,6 +1892,19 @@ test entry-6.11 {EntryComputeGeometry procedure} -constraints { } -cleanup { destroy .e } -result {1 1 1} +test entry-6.12 {EntryComputeGeometry procedure} -constraints { + fonts +} -setup { + catch {destroy .e} + entry .e -font $fixed -bd 2 -relief raised -width 20 + pack .e +} -body { + .e insert end "012\t456\t" + update + list [.e index @81] [.e index @82] [.e index @116] [.e index @117] +} -cleanup { + destroy .e +} -result {6 7 7 8} test entry-7.1 {InsertChars procedure} -setup { diff --git a/tests/font.test b/tests/font.test index abe6ebf..9e44a93 100644 --- a/tests/font.test +++ b/tests/font.test @@ -1526,11 +1526,11 @@ test font-24.10 {Tk_ComputeTextLayout: tab caused break} -body { set x {} .t.l config -text "000\t" update - lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}] + lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 8}]}] lappend x [expr {[winfo reqheight .t.l] eq $ay}] .t.l config -text "000\t00" -wrap [expr $ax * 6] update - lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 3}]}] + lappend x [expr {[winfo reqwidth .t.l] eq [expr {$ax * 8}]}] lappend x [expr {[winfo reqheight .t.l] eq [expr {$ay * 2}]}] return $x } -cleanup { |