On Fri, Jun 29, 2007 at 11:17:51AM +0300, Dov Feldstern wrote: > Right now it's being called on every cursor blink, I think (I put in a > debug printout, and it prints on every blink); and what it's doing every > time is to loop over all the characters from the beginning of the line > until the current position, and sum up the widths, in order to get to > the current X position. Same thing when you move one position to the > right or to the left --- the entire summing start from the beginning of > the line. But this calculation was already done when we painted the > screen, so there's no need to do it again. > > This may not be very costly relative to the painting, but it's certainly > much more wasteful than it needs to be.
And the proposed solution is to have a cache for each position in the document? You lost me... Andre'