On Mon, 2005-11-07 at 12:34 +0100, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > >> Can this go in? I have a good feeling about it. > > Martin> Ping... > > Oh, I thought it was already in. I think it can go in, but I have a > question first. Please pardon me if it has already be beaten to death, > I did not follow the various scrollbar-related threads... > > It seems to me that in CoordCache we have metrics information for the > paragraphs in the current page (and the pages before/after). From > this, we should be able to compute the total height of these > paragraphs. If we divide this by the number of paragraphs in tis range > and multiply by the total number of paragraphs, aren't we guaranteed > to have the best possible (wrt the info we have) estimation of the > total document height? It seems also that there is no risk to have a > scrool bar that is too large... > > So, why would this solution be wrong?
It appears right to me in principle. It also has the merit that, once the overly big "problem paragraph" has been in view, this average will be too high rather than too low, so the tail of the doc will always be shown fully. I did however notice in my experimentation, that reducing the estimated average paragraph height after first increasing it will (may) lead to some erratic jumping around of the cursor location. I couldn't put my finger on it precisely, but chose a solution where the est-av-par-ht can only be increased, not decreased. In my patch, the est-av-par-ht is the upper bound for the average paragraph heights of all screenfuls that have been in view. Slightly less optimal, but robust, and with the same nice property mentioned above. The patch is IMO good enough for 1.4 and we should not now spend time on refinement, though your idea is actually very good, I think. - Martin
signature.asc
Description: This is a digitally signed message part