Dov Feldstern wrote:
Abdelrazak Younes wrote:
Dov Feldstern wrote:

We would also have to decide where the correct place for this cache is
(TextMetrics?);

Cursor seems like the ideal place for that.

should caching occur for the entire paragraph (or even
document), or just for the line which the cursor is in?

I don't follow you... there is a single cursor position.

I may not have explained myself clearly: cursorX is a function which gets a position in the text (a slice), and returns the X coordinate for that position. So what we would be caching is not the current position of the cursor, but rather "where should the cursor be drawn when it is moved to position so-and-so". There are many of those --- one X for every position on the document. The question is, how many of these positions should be cached: just for the line the cursor is currently in, or the entire paragraph, or maybe the entire document?

I think this cleanup will be part of the upcoming rowpainter rewrite. The problem we have now is that the metrics and coords caching are partly done before the painting and the rest is done during the painting. If I get to find some time, I will put everything to pre-painting time.

Abdel.

Reply via email to