On Sat, Nov 06, 2004 at 09:02:23PM +0100, Alfredo Braunstein wrote: > > The only clean solution I can see is to reorganze the current two > > drawing phases (1. metrics, 2. draw, including pos cache setting) > > into four: > > > > 1. metrics > > 2. pos cache setting > > 3. selection drawing > > 4. text/inset drawing > > > > This is conceptually no big change but we would need to touch quite a > > few inset's draw() methods. > > Actually, I've done exactly this for the outer LyXText (have a look). > > This is not possible for inner insets, because you don't have the complete > pos cache after metrics (you need the draw step to have the x positions) > and moreover, you don't even have the y positions after doing its own > metrics (the size of following things could change its position)
I think it is. Step 2 is basically a copy of 4 without the actual drawing. In fact, for a quick-and-dirty solution, calling draw() with a 'NullPainter' would do. [We have such a thing somewhere, don't we?] > *But* > it is ok for outer paragraphs: after their metrics we have everything > y-related. And outer paragraphs is all we need for getting absolute > coodinates for selection*. > > Again, it works fine here now so finding something better is 1.5.x business > at best IMO. Ok, fine. > * (The rest is then asked recursively to insets [with your > coordOffset/inset.getCursorPos]) > > I'll commit briefly the last fix I have in the selection area (out-of-screen > endpoints) > > Alfredo (fighting with cvs branches but please don't switch to subversion > now that I'm starting to understand them ;-) I am out of business anyway... Andre'