On Wed, Sep 17, 2003 at 12:44:06PM +0200, Alfredo Braunstein wrote: > Andre Poenitz wrote: > > > I think one solution which sounds expensive but probably is not at all > > is to get rid of the RowLists entirely and re-compute everything on > > demand (i.e. once per user interaction - we do something similar > > already). This way one paragraph can be shown in two places without > > problems and without having 'RowList caches'. > > I think it's feasible, but very tricky. We will have to deal with unknown y > positions? If you are only rebreaking what it's shown, then the y position > of on screen paragraphs would be unknown.
We'd may need some size cache. This can live in the BufferView as a map<Paragraph *, Position> map<Inset *, Position> or similar which gets filled in the initial metrics phase and updated in each draw. To access something by coordinate, browse that cache. > Otherwise you'll have to "remember" y positions on buffer switching and we > are back to the same problem IMHO. The problem is indeed similar, but on a much smaller scale. > > This would leave only cursor and selection data in the LyXText which > > could be moved easily to the BufferView - especially so if we have a > > 'global cursor'. > > Excelent. > > > So I am not too concerned about the violation of the data/view > > separation as my guess is that we won't need the data in the end and it > > does not matter whether we remove it from a nicely spearated scheme or > > some mess... > > And I hope you mean that we won't need the view ;-) No. Andre'