Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 4616) +++ trunk/src/draw.c (revision 4617) @@ -59,7 +59,6 @@ * some local identifiers */ -/* the minimum box that needs to be redrawn */ BoxType pcb_draw_invalidated = { MAXINT, MAXINT, -MAXINT, -MAXINT }; static int doing_pinout = 0; @@ -145,19 +144,6 @@ gui->set_color(Output.fgGC, color); } -/*--------------------------------------------------------------------------- - * Adds the update rect to the update region - */ -static void pcb_draw_invalidate(void *b) -{ - BoxType *box = (BoxType *) b; - - pcb_draw_invalidated.X1 = MIN(pcb_draw_invalidated.X1, box->X1); - pcb_draw_invalidated.X2 = MAX(pcb_draw_invalidated.X2, box->X2); - pcb_draw_invalidated.Y1 = MIN(pcb_draw_invalidated.Y1, box->Y1); - pcb_draw_invalidated.Y2 = MAX(pcb_draw_invalidated.Y2, box->Y2); -} - /* * initiate the actual redrawing of the updated area */ Index: trunk/src/draw.h =================================================================== --- trunk/src/draw.h (revision 4616) +++ trunk/src/draw.h (revision 4617) @@ -56,6 +56,20 @@ pcb_draw_inhibit--; \ } while(0) \ +/* the minimum box that needs to be redrawn */ +extern BoxType pcb_draw_invalidated; + +/* Adds the update rect to the invalidated region. This schedules the object + for redraw (by Draw()). obj is anything that can be casted to BoxType */ +#define pcb_draw_invalidate(obj) \ +do { \ + BoxType *box = (BoxType *)obj; \ + pcb_draw_invalidated.X1 = MIN(pcb_draw_invalidated.X1, box->X1); \ + pcb_draw_invalidated.X2 = MAX(pcb_draw_invalidated.X2, box->X2); \ + pcb_draw_invalidated.Y1 = MIN(pcb_draw_invalidated.Y1, box->Y1); \ + pcb_draw_invalidated.Y2 = MAX(pcb_draw_invalidated.Y2, box->Y2); \ +} while(0) + void Draw(void); void Redraw(void); void DrawVia(PinTypePtr);