[squeak-dev] Re: Re: A better looking text caret (IMO)

Igor Stasenko siguctua at gmail.com
Mon Feb 25 19:24:57 UTC 2008


Andrew,

i propose to change TextMorph>>#step method to following:

step
	(paragraph notNil and:[paragraph focused])
		ifTrue:[
			paragraph toggleCaretBlinkShow.
                        self invalidRect: self caretRect
 ]


and new method #caretRect should return a bounds which currently
occupied by caret.
Then, hopefully, textmorph will redraw only single line each step, not
everything visible on it.

The problem is with determining this rect..
An easy way can be to add an ivar (caretRect) and update it during
selection change or during textmorph redraw.
Or.. if there are way to determine these bounds with short
calculation, then we don't need adding ivar.

Have any ideas, how #caretRect should look like?

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list