Mantis - tweak
Viewing Issue Advanced Details
397 minor always 10-15-04 22:33 10-15-04 22:33
riks  
 
normal  
new  
open  
none    
none  
0000397: CTextParagraphEditor inaccurately reports visible lines
It at least omits the top line
To reproduce:
open a TextEditor
type '1
2'
Open inspector. (self editor visibleLines) printIt
Observe #(a TextLine 3 to: 3)
type <return> after the 2, or before the 1 and reobserve.

Quick-guess work-around fix:
updateParagraphExtent
    | rightX |
    paragraph ifNil:[paragraph := CTextParagraph new].
    rightX := (self textBounds insetBy: inset) extent x.
    (self wrapContents) ifTrue:[
        paragraph
            compose: text
            style: paragraph textStyle
            from: 1
            in: (0@1 extent: rightX @ 999999999).
    ] ifFalse:[
        paragraph
            compose: text
            style: paragraph textStyle
            from: 1
            in: (0@1 extent: 999999999 @ 999999999).
        paragraph adjustRightXBy: 999999999 - paragraph width.
    ].
Then I see results #(a TextLine 1 to: 2 a TextLine 3 to: 3)
which is as expected

There are no notes attached to this issue.