Angus Leeming wrote: > > 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.
#:O) > BufferView * bv = ...; // I have a cached copy of this. Where are you here. Where should the below piece of code pe placed. (this is important to know!) > LyXText * text - bv->getLyXText(); You only care for bv->text. For this stuff you have always start from the topmost place IMO. > int const top_y = text->first_y; This cannot be const as it is set in the below call to the right y value! > Row * row = text->getRowNearY(top_y); > Paragraph * par = row->par(); Otherwise your pretty there ;) > 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(). No I think you always should load all of one paragraph and then check if the first row of the following paragraph is still visible on screen if yes iterate above. > Am I on the right track? Yes more or less, but I will bring you there #:O) Jug -- -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._ Dr. Jürgen Vigna E-Mail: [EMAIL PROTECTED] Mitterstrich 151/A Tel/Fax: +39-0471-450260 / +39-0471-450253 I-39050 Steinegg Web: http://www.lyx.org/~jug -._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._