Abdelrazak Younes wrote:
Abdelrazak Younes wrote:
Andre Poenitz wrote:

Good in theory but it looks as if this is the kind of infomration that
would be useful for a 'non-drawing real painter' (as opposed to the
original nullpainter)

I have implemented that and got rid of the NullPainter altogether:

Shit... Some of my LyXText changes got in there. I will clean that up immediately, should compilable again soon.

Here is the real rawpainter.C diff:

Index: D:/devel/lyx/trunk/src/rowpainter.C
===================================================================
--- D:/devel/lyx/trunk/src/rowpainter.C (revision 15605)
+++ D:/devel/lyx/trunk/src/rowpainter.C (revision 15614)
@@ -851,7 +851,11 @@
                if (repaintAll || row_has_changed || cursor_on_row) {
                        // Add to row signature cache
                        par.rowSignature()[rowno] = row_sig;
-
+                       
+                       bool const inside = (y + rit->descent() >= 0
+                               && y - rit->ascent() < ww);
+                       // it is not needed to draw on screen if we are not 
inside.
+                       pi.pain.setDrawingEnabled(inside);
                        RowPainter rp(pi, text, pit, *rit, x, y);
                        // Clear background of this row
                        // (if paragraph background was not cleared)
@@ -887,6 +891,9 @@
                // Restore, see above
                refreshInside = tmp;
        }
+       // Re-enable screen drawing for future use of the painter.
+       pi.pain.setDrawingEnabled(true);
+
        lyxerr[Debug::PAINTING] << "." << endl;
 }

Reply via email to