On Tuesday 09 July 2002 8:28 am, Juergen Vigna wrote:
> Angus Leeming wrote:
> > On Monday 08 July 2002 4:36 pm, Juergen Vigna wrote:
> >>Ok. No we don't have a isVisible function right now and I don't think
> >>this is easy to make as the "visibility" depends on the x,baseline
> >>values passed as parameters to draw, which could change if I have to
> >>rebreak the text after the loading. You could have a look at the
> >>tabular.C or insettext.C draw functions. I just draw the visible
> >>parts there, but for a graphics file with a fixed hight it could
> >>be as easy as "if baseline+graphics_height > 0 then draw".
>
> I forgot here obviously that it should be < screen height!

Jürgen, I'm sinking fast in a pile of poo. However I think that this gives me 
the paragraph that is currently visible at the top of the LyX screen.

BufferView * bv = ...; // I have a cached copy of this.
LyXText * text - bv->getLyXText();
int const top_y = text->first_y;
Row * row = text->getRowNearY(top_y);
Paragraph * par = row->par();

If that's right, then that's all I need. I'll just load all previews for 
insets in the 5 pars on either side of this using Paragraph::next() and 
Paragraph::previous().

Am I on the right track?

Angus


Reply via email to