Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 14677) +++ trunk/src/data.c (revision 14678) @@ -746,6 +746,7 @@ return; PCB_POLY_ALL_LOOP(data); { -#warning TODO: do the clipping here + if (polygon->clip_dirty) + pcb_poly_init_clip(data, layer, polygon); } PCB_ENDALL_LOOP; } Index: trunk/src/obj_poly.h =================================================================== --- trunk/src/obj_poly.h (revision 14677) +++ trunk/src/obj_poly.h (revision 14678) @@ -46,6 +46,7 @@ pcb_cardinal_t *HoleIndex; /* Index of hole data within the Points array */ pcb_cardinal_t HoleIndexN; /* number of holes in polygon */ pcb_cardinal_t HoleIndexMax; /* max number from malloc() */ + unsigned clip_dirty:1; /* 1 if polygon should be reclipped after clipping inhibit is over */ gdl_elem_t link; /* a poly is in a list of a layer */ }; Index: trunk/src/polygon.c =================================================================== --- trunk/src/polygon.c (revision 14677) +++ trunk/src/polygon.c (revision 14678) @@ -1878,6 +1878,14 @@ return PCB_R_DIR_NOT_FOUND; } +/* poly plows while clipping inhibit is on: mark any potentail polygon dirty */ +static pcb_r_dir_t poly_plows_inhibited_cb(pcb_data_t *data, pcb_layer_t *lay, pcb_poly_t *poly, int type, void *ptr1, void *ptr2) +{ + poly->clip_dirty = 1; + return PCB_R_DIR_FOUND_CONTINUE; +} + + int pcb_poly_plows(pcb_data_t * Data, int type, void *ptr1, void *ptr2, pcb_r_dir_t (*call_back) (pcb_data_t *data, pcb_layer_t *lay, pcb_poly_t *poly, int type, void *ptr1, void *ptr2)) @@ -1886,6 +1894,9 @@ int r = 0, seen; struct plow_info info; + if (Data->clip_inhibit > 0) + call_back = poly_plows_inhibited_cb; + info.type = type; info.ptr1 = ptr1; info.ptr2 = ptr2;