Code

patch by Dennis Lin: optionally for debugging paint the rect-to-redraw yellow
authorbuliabyak <buliabyak@users.sourceforge.net>
Sat, 18 Aug 2007 22:36:06 +0000 (22:36 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sat, 18 Aug 2007 22:36:06 +0000 (22:36 +0000)
src/display/sp-canvas.cpp

index 05abaccb203fc8df6d4c387428b348c123d148c8..82b2a349006146b7199b91d7052381efd79aa027 100644 (file)
@@ -37,6 +37,9 @@
 #include "box3d-context.h"
 #include "inkscape.h"
 
+// Define this to visualize the regions to be redrawn
+//#define DEBUG_REDRAW 1;
+
 // Tiles are a way to minimize the number of redraws, eliminating too small redraws. 
 // The canvas stores a 2D array of ints, each representing a TILE_SIZExTILE_SIZE pixels tile.
 // If any part of it is dirtied, the entire tile is dirtied (its int is nonzero) and repainted.
@@ -1829,6 +1832,16 @@ sp_canvas_paint_rect (SPCanvas *canvas, int xx0, int yy0, int xx1, int yy1)
     rect.x1 = MIN (rect.x1, canvas->x0/*draw_x1*/ + GTK_WIDGET (canvas)->allocation.width);
     rect.y1 = MIN (rect.y1, canvas->y0/*draw_y1*/ + GTK_WIDGET (canvas)->allocation.height);
 
+#ifdef DEBUG_REDRAW
+    // paint the area to redraw yellow
+    gdk_rgb_gc_set_foreground (canvas->pixmap_gc, 0xFFFF00);
+    gdk_draw_rectangle (SP_CANVAS_WINDOW (canvas),
+                            canvas->pixmap_gc,
+                            TRUE,
+                            rect.x0 - canvas->x0, rect.y0 - canvas->y0,
+                            rect.x1 - rect.x0, rect.y1 - rect.y0);
+#endif                     
+
     // Clip rect-aborted-last-time by the current visible area
     canvas->redraw_aborted.x0 = MAX (canvas->redraw_aborted.x0, canvas->x0);
     canvas->redraw_aborted.y0 = MAX (canvas->redraw_aborted.y0, canvas->y0);