Hello Jean-Marc,

> > Unfortunately, this code exists to avoid painting too much stuff, so we
> > have to cope with it. We cannot afford to repaint the whole screen every
> > time the user moves the cursor, it can be really horrible, especially on
> > Mac OS X. I will try to post a patch tomorrow illustrating the way I
> > propose to tackle the problem.
> 
> Here is a tentative patch. However it does not work since it seems that 
> BufferView::draw does not get called when using home/end...

I tried both of the above patches that you have sent me. But nothing was
able to solve the problem I mentioned. (When entering Math inset from right
edge, row slides unexpectedly to the left most position.) However bellow
code solved the above mentioned problem. 

@@ -2874,24 +2921,26 @@ void BufferView::draw(frontend::Painter & pain)
                // because of the single backing pixmap.
 
        case FullScreenUpdate:
-               // The whole screen, including insets, will be refreshed.
-               pi.full_repaint = true;
+               for(int i=0;i<2;i++){
+                       // The whole screen, including insets, will be refreshed
+                       pi.full_repaint = true;
 
-               // Clear background.
-               pain.fillRectangle(0, 0, width_, height_,
-                       pi.backgroundColor(&buffer_.inset()));
+                       // Clear background.
+                       pain.fillRectangle(0, 0, width_, height_,
+                               pi.backgroundColor(&buffer_.inset()));
 
-               // Draw everything.
-               tm.draw(pi, 0, y);
+                       // Draw everything.
+                       tm.draw(pi, 0, y);
 
-               // and possibly grey out below
-               pair<pit_type, ParagraphMetrics const *> lastpm = tm.last();
-               int const y2 = lastpm.second->position() + lastpm.second->descen
+                       // and possibly grey out below
+                       pair<pit_type, ParagraphMetrics const *> lastpm = tm.las
+                       int const y2 = lastpm.second->position() + lastpm.second
                
-               if (y2 < height_) {
-                       Color color = buffer().isInternal() 
-                               ? Color_background : Color_bottomarea;
-                       pain.fillRectangle(0, y2, width_, height_ - y2, color);
+                       if (y2 < height_) {
+                               Color color = buffer().isInternal() 
+                                       ? Color_background : Color_bottomarea;
+                               pain.fillRectangle(0, y2, width_, height_ - y2, 
+                       }
                }
                break;
        }


I am sure that is no way a good solution. 
I am not sure where the draw method is called twice when we are sliding
rows, in the code given by you. Could you please help?

> Attachment
(0001-Move-code-that-updates-cursor-row-left-edge-to-Buffe.patch):
text/x-patch, 4095 bytes

Thank you
Hashini



Reply via email to