Abdelrazak Younes ha scritto:
I've played with it a bit together with Tommaso (off-list).
Confirmed. I made an attempt of refactory of the overall logics,
completely getting rid of the par height estimates, replaced by
appropriate loops summing up heights. This of course
ended up in a perfectly smooth scrolling, also in cases of large
tables and pictures, but completely crazy cursor movements
that crashed LyX. I was keeping in memory the entire document
metrics, but Abdel warned me about memory usage, so I decided
to use a vector of heights, plus the current cache.
Unfortunately, I had to work in the last few weeks, so I couldn't
finish the job.
I think most other applications do some layouting in the background to get those height values. Has anybody tried to do the same with LyX?
In my idea, this would be the most usable thing: right after opening
a document, the scrollbar keeps adjusting for a few seconds. After
that moment, everything scrolls fine. If you resize horizontally, then
the process is repeated.
One could fill up the height cache in idle times for example after the document is loaded, maybe with some regulation to not stress the machine too much.
You don't really need a map. A vector of height for the outermost paragraphs should be enough. Initially the vector would be filled with nominal values. Each time a paragraph metrics is calculated, the nominal value will be replaced by the real height. We have to be careful to maintain the vector in line with the main paragraph list.
Infact.

   T.

Reply via email to