Andre Poenitz wrote:

> On Wed, Nov 03, 2004 at 01:57:59PM +0100, Alfredo Braunstein wrote:
>> The most obvious regression is that the cursor doesn't leave the exact
>> vertical center of the screen.
> 
> That was sort of intentional for the time being as it help to fix one
> part of the the problem at a time. Right now the main goal was to get
> paragraph breaking and cursor movement right. Selecting the correct y
> position is fairly orthogonal to this.
> 
> But if you found that it's barely usable work on the other side could
> begin...
> 
>> I'll work on removing this limitation (sort of reintroduce the
>> anchor thingy - *another* cursor position + y vertical offset).
> 
>> Btw, I didn't appreciate at all that you have *removed* fitCursor and
>> friends. The fact that fitCursor isn't used in this version is a
>> consequence of the limitations of this approach, but we certainly need it
>> in the final version.
> 
> In hindsight you are propably right. It didn't really occur to me that
> we sometimes view positions far from the cursor (scrolling with
> non-following cursor, I don't do that. From this POV 'fitCursor' is
> superfluous as the cursor alwways fits per definition.
> 
> So we should not/cannot use the _cursor_ as primary information but
> something like your 'anchor position' (maybe just outer paragraph index
> + small y offset  instead of a full DocIterator).

Yes, I've arrived to the same conclusion fortunately (and implemented it).
One problem that I inmediately had was selections. The whole scheme was too
much dependent on the cursor having good coordinates (which was always
correct because was always on screen), and this was hidding a small
problem:

You have moved the selection painting code out of rowpainter and put it
between the two drawing steps (after redoParagraph and before paintPar).
The problem was that there, y information of paragraphs was not available
yet and was needed for drawing the selection. Fortunately, I realised that
y information (height and position) for *outer* pars is indeed available
after the redoParagraph scan, and can be then be sent to the cache right
away. The whole is a bit delicate for my taste... maybe I liked the
selection painting in rowpainter was better (what where the
disadvantages?).

Alfredo


Reply via email to