Georg Baum wrote:
Abdelrazak Younes wrote:

As I said, there is way to solved that issue differently by painting the
corners independently from the text.

I am not going to rip the draw machinery apart right now, because I don't
know enough about it and I also think that now is not the right moment to
do so.

Well, your patch is much riskier believe me. I was about to propose to do that myself and it is basically the opposite of what your patch is doing. I create a Decoration flag used only in math (but that can be used later by other inset).

But since uncommenting the cur.updateFlags() calls did solve the
problem I had the idea to only suppress the deletion of the coord cache,
not the drawing of the insets itself in these cases. Whether we draw the
text again even if we would only need to draw the pink corners does not
matter, and if it is slower this is preferrable over an off-screen cursor.
This is what the attached patch does. I added a new flag ClearCoordCache and
set it in all places where any update flag was set. Then I made sure that
this flag is not set in the lfuns in MathNestInset that do not need it, and
I finally clear the coord cache only if this flag is set.
This works very well for me, and if I don't get any objections I will put
this in.

Please wait as this seems clearly a wrong solution to me. I'll try to finish the patch, and I don't think it will be big either.



BTW, it looks like the cause for this bug in 1.4 and 1.5 is a bit
different: In 1.4 the cache did not get set (I also get frequent aborts
via lyxbreaker if I try to go up with the arrow keys). In 1.5 it seems
that it gets set (I don't get these aborts, pressing the arrow will
simply move the cursor above the screen, and it becomes visible again if
it goes out of the inset.
Yes, that's because, in 1.5, when the info is not in the cache, we use
the logical information. A FitCursor is probably missing here.

You mean in 1.4? That may be the case. In 1.5 I don't think so, since the
screen is correctly scrolled with this patch applied.

Yes, I guess this is because then the CoordCache is not cleared.

        case LFUN_CHAR_FORWARD:
-               // FIXME: we have to enable full redraw here because of the
-               // visual box corners that define the inset. If we know for
-               // sure that we stay within the same cell we can optimize for
-               // that using:
-               //cur.updateFlags(Update::FitCursor);

Hum, even if you commit your patch the FIXME above is still true.

Abdel.

Reply via email to