Tk Source Code

Ticket Change Details
Login
Overview

Artifact ID: 4b0a14b31afcedeba6d46c124cd0767aca39f034
Ticket: 7703f947aa6682d6cc057798f2029d50bef3c24e
Many many issues with elided lines in the text widget
User & Date: fvogel 2014-12-28 21:03:35
Changes

  1. icomment:
    Further fixed (in branch text-elided) 'text see' with indices in elided lines, since previous fixes such as [5f352f3a71] were not correct in all cases.
    
    Now ALL calls to CalculateDisplayLineHeight use an index that is at the start of a display line, as requested by CalculateDisplayLineHeight.
    
    Test case 'L':
    --------------
    package require Tk
    pack [text .t]
    pack configure .t -expand 1 -fill both
    for {set i 1} {$i < 50} {incr i} {
        .t insert end "Line $i\n"
    }
    # button just for having a line with a larger height
    button .t.b -text "Test" -bd 2 -highlightthickness 2
    .t window create 21.0 -window .t.b
    wm geometry . 300x200+0+0
    .t tag add hidden 15.36 21.0
    .t tag configure hidden -elide true
    # Indices 21.0, 17.0 and 15.0 are all on the same display line
    # therefore index @0,0 shall be the same for all of them
    .t see end
    update
    .t see 21.0
    update
    set ind1 [.t index @0,0]
    .t see end
    update
    .t see 17.0
    update
    set ind2 [.t index @0,0]
    .t see end
    update
    .t see 15.0
    update
    set ind3 [.t index @0,0]
    list [expr {$ind1 == $ind2}] [expr {$ind1 == $ind3}] ; correct is {1 1}
    
  2. login: "fvogel"
  3. mimetype: "text/plain"