On Wed, Jun 14, 2006 at 10:23:43AM -0400, Bennett Helm wrote: > On Jun 14, 2006, at 4:14 AM, Martin Vermeer wrote: > > >Attached a slightly better (less visually intrusive) solution. > > > >The logic is still the same, but now it draws a real box (with fixed > >dimensions) not extending to the canvas edge. > > > >It appears to work OK in my limited testing. Note that now insets > >within > >insets never go Wide, I hope Bennett is OK with that (i.e., the slower > >rendering that this implies). > > It's not good on Mac. With nested insets, it is trivial for me to get > significant cursor lag when typing: with even just one inset nested > inside another (and just enough text in these insets to fill the LyX > window), I have to wait 5 seconds after typing a sentence for LyX to > catch up. Without this patch, there is no lag, even with many large > insets nested many layers deep.
That's what I expected. Is this a realistic use case? I seem to remember it was for you. Then the attached patch is better (though visually not as nice). - Martin
Index: rowpainter.C =================================================================== --- rowpainter.C (revision 14084) +++ rowpainter.C (working copy) @@ -836,8 +837,8 @@ // (if paragraph background was not cleared) if (!repaintAll && (!in_inset_alone_on_row || row_has_changed)) { - pi.pain.fillRectangle(( rowno ? 0 : x - 10 ), y - rit->ascent(), - pi.base.bv->workWidth(), rit->height(), + pi.pain.fillRectangle(10, y - rit->ascent(), + pi.base.bv->workWidth() - 40, rit->height(), text.backgroundColor()); // If outer row has changed, force nested // insets to repaint completely Index: insets/insettext.C =================================================================== --- insets/insettext.C (revision 14084) +++ insets/insettext.C (working copy) @@ -209,8 +209,7 @@ int const h = a + text_.descent() + border_; int const ww = pi.base.bv->workWidth(); if (w > ww - 40 || Wide()) { - pi.pain.line(0, y - a, ww, y - a, frameColor()); - pi.pain.line(0, y - a + h, ww, y - a + h, frameColor()); + pi.pain.rectangle(10, y - a, ww - 40, h, frameColor()); } else { pi.pain.rectangle(x, y - a, w, h, frameColor()); } @@ -225,7 +224,7 @@ int const h = a + text_.descent() + border_; int const ww = pi.base.bv->workWidth(); if (Wide()) - pi.pain.fillRectangle(0, y - a, ww, h, + pi.pain.fillRectangle(10, y - a, ww - 40, h, backgroundColor()); else pi.pain.fillRectangle(x, y - a, w, h,
pgp7OQSEXErW9.pgp
Description: PGP signature