Andre Poenitz wrote:

>> Honestly, I think this would be nonsense. fitCursor has a 1-to-1
>> correspondence with a concrete feature. I think that Andrà had always
>> cursor-follows-scrollbar and simple ignored (or forgot) the other case.
> 
> I did forget it. However, the primary source of y position does not have
> to be the Cursor, a paragraph index in the outer inset + some small y
> offset for smoother scroll would do as well. And this could well be
> derived (i.e. approximated) from
> 
> This paragraph inset + small y poffset is more or less equivalent to
> Alfredos  anchor row but does not depend on _row_ infomation. The idea
> is really to make the row cache a _cache_, i.e. something that helps to
> speed up things but which is technically not required.

Cool, this is exactly what I've done in CoordBranch.

> Cursor down would than simply leave the (pit, yoffset) untouched as long
> as the cursor stays on screen. When the cursor goes further down, the
> yoffset is adjusted until a full paragraph have scrolled off the screen.
> Than the pit is incremented an yoffset -= paragraphs_[pit].height().
> 
> Same for 'up'.
> 
> When scrolling with the scrollbar and non-following cursor we
> approximate a (pit, yoffset) pair from the slider position.
> 
> Say slider gives something in the range [0..1], we'd use
> pit = int(pars.size() * slider)
> yoffset = (pars.size() * slider - pit) * pars[pit].height()
> [or similar +/- one]

These details are missing ;-) Right now scrolling goes par by par. (the y
offset is there, but always 0 for the moment)


>> > plan. I guess Andre has ideas on how to remove the limitations...
>> 
>> Note that the limitations have little to do with fitCursor (except
>> the fact that with the limitations, the cursor is always on screen so
>> fitCursor is noop) Well if he/you have, it would be a good moment to
>> discuss it. In fact I've started this discussion before
>> (http://marc.theaimsgroup.com/?l=lyx-devel&m=109614325020341&w=2), but
>> nobody answered.
>> 
>> I think that we need:
>> 
>> - another document iterator in bv ("anchor") - an y offset
> 
> The anchor should be pit in main text + y offset. Idea is to keep the
> y offset small as this is the range in which we need exact y
> information, i.e. the range in which paragraphs need to be rebroken.

Perfect (I've done this).

Alfredo


Reply via email to