On Tue, Nov 11, 2003 at 08:52:59AM +0100, Alfredo Braunstein wrote:
> Andre Poenitz wrote:
> 
> > On Mon, Nov 10, 2003 at 11:51:31PM +0100, Alfredo Braunstein wrote:
> >> One of the problems I see is that the insets lose track of their position
> >> if we scroll away.
> >> 
> >> Maybe a solution would be to cache the absolute y position of the tip
> >> inset in LCursor as soon as it is push()ed.
> >> 
> >> If this seems reasonable I would try to do it tomorrow.
> > 
> > Don't you think we should just move to absolute screen coordinates
> > everywhere?  This scheme looks robust and simple...
> 
> But this is exactly the problem right now: if you scroll with the scrollbar,
> the coordinates where the cursor is remain invalid, and so a future
> fitCursor call has no enough info.

Ah yes. Eggen and chick... We can't draw as we identify the places to
be drawn by the cursor, yet we can't set the cursor as we don't have
enough valid coordinate infomartion in the vicinity.

Well.

What about decoupling of drawing and cursor?

Primary draw information would by 'y_top'. Scrolling down would simply
add 200 pixels to y_top. We have the y coordinates of all outer
paragraphs as we call updateRowPositions() from time to time.

So we can identify the range of outer level paragraphs that are
visible. Draw them and take a note of the cursor position. If this is
off-screen (which should not happen too often), correct y_top and
re-draw.

Urm... no. The problem is that we don't already have the cursor 200
pixel down, we want to set it there.

So what about the folling: Increase the range of drawn outer paragraphs
a bit, i.e. add a strip covering cursor.y + 200 and cursor.y - 200.
When drawing, record the par/pos positions closest to cursor.x/y+-200.
On 'PageDown' just set the cursor there, add 200 to y_top and redraw?

Andre'

-- 
Those who desire to give up Freedom in order to gain Security, will not have,
nor do they deserve, either one.     (T. Jefferson or B. Franklin or both...)

Reply via email to