On Fri, May 13, 2005 at 09:46:29PM +0300, Martin Vermeer wrote:
> Actually it should be noted that paintText called from LyXScreen::redraw
> still draws _three_ paragraphs: the one containing the cursor, and the 
> ones above and below, see rowpainter.C. I'm sure there is a good reason
> for this when redrawing the whole screen...

We need up-to-date metrics in the paragraph below to handle e.g. <Down>
when the cursor is in the last line of a paragraph. 

I think this was the reason before the null painter was invented...

> we could easily propagate the bool onlypar (by adding it to
> ViewMetricsInfo?) to prevent also this, giving a further speed-up.
> 
> Is this a sensible direction?

I think so.

> -void BufferView::update(bool fitcursor, bool forceupdate)
> +void BufferView::update(bool fitcursor, bool forceupdate, bool onlypar)
>  {
> -     pimpl_->update(fitcursor, forceupdate);
> +     pimpl_->update(fitcursor, forceupdate, onlypar);
>  }

Pretty much looks like the old update flags now. I knew there must have
been a reason...

enum UpdateFlags { UpdateFitCursor = 1, UpdateForce = 2, UpdateOnlyPar =
4 };

 +      void update(UpdateFlags = UpdateFitCursor | UpdateForce);


This makes things like

> +                     cur.bv().update(false, true, true);

a bit mmore readble:

                        cur.bv().update(UpdateForce | UpdateOnlyPar);

Andre'

Reply via email to