Tommaso Cucinotta wrote:
Abdelrazak Younes ha scritto:
We don't need a *perfect* scrolling behaviour, just a sensible one.
I agree we may accept a non-perfect scrolling right after having opened
a document, or having made great changes. But, IMHO, after a while
it would be better to have a precise behaviour, while reading you doc,
searching for places to improve/change and editing.
I think that updating the par height the moment it is displayed on
screen would be enough.
A simple cache of paragraph height would do the job and I wish Tommaso
had followed this direction instead.
Well, this is actually what I did, except I'm caching also the width,
the ascent and the descent, along with the height. Thought they could
have turned out to be useful, someday.
I don't think this is useful. In any case, it is not useful now so why
the memory waste?
Basically, first I added a vector of heights, but immediately after I
realized it was sufficient to reuse the ParagraphMetrics type, with
the rows_ field cleared.
I understand your reasoning but I disagree, sorry... see below.
So, the par_metrics_[] vector contains width,
height, asc and desc of all *outer* paragraphs in the document, while
only visible ones have the .rows() collection filled in.
I don't like this distinction. I prefer all or nothing. Actually I
planned to have partial metrics also for non-main Insets. You are doing
the other way around: full metrics for the main Inset.
Well, it is not really a cache in the "cache" sense...
Not in your patch no.
Abdel.