Index: trunk/src/flag.h =================================================================== --- trunk/src/flag.h (revision 11665) +++ trunk/src/flag.h (revision 11666) @@ -78,6 +78,7 @@ PCB_FLAG_ONSOLDER = 0x00080, /*!< For elements and pads, indicates that they are on the solder side. */ PCB_FLAG_AUTO = 0x00080, /*!< For lines and vias, indicates that these were created by the autorouter. */ PCB_FLAG_SQUARE = 0x00100, /*!< For pins and pads, indicates a square (vs round) pin/pad. */ + PCB_FLAG_CLEARPOLYPOLY= 0x00100, /*!< For polygons, apply clearance to nearby polygons */ PCB_FLAG_RUBBEREND = 0x00200, /*!< For lines, used internally for rubber band moves: indicates one end already rubber banding. */ PCB_FLAG_WARN = 0x00200, /*!< For pins, vias, and pads, set to indicate a warning. */ PCB_FLAG_USETHERMAL = 0x00400, /*!< Obsolete, indicates that pins/vias should be drawn with thermal fingers. */ Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 11665) +++ trunk/src/obj_subc.c (revision 11666) @@ -193,10 +193,32 @@ dst = pcb_subc_layer_create_buff(sc, src); while((line = linelist_first(&src->Line)) != NULL) { - linelist_remove(line); - linelist_append(&dst->Line, line); - PCB_SET_PARENT(line, layer, dst); - PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND | PCB_FLAG_SELECTED, line); + char *sq; + + sq = pcb_attribute_get(&line->Attributes, "elem_smash_shape_square"); + if ((sq != NULL) && (*sq == '1')) { /* convert to polygon */ + pcb_coord_t x[4], y[4]; + int n; + + pcb_sqline_to_rect(line, x, y); + + poly = pcb_poly_new(dst, pcb_no_flags()); + for(n = 0; n < 4; n++) + pcb_poly_point_new(poly, x[n], y[n]); + pcb_add_polygon_on_layer(dst, poly); +/* pcb_poly_init_clip(st->pcb->Data, dst, poly);*/ + PCB_FLAG_SET(PCB_FLAG_CLEARPOLYPOLY, poly); + pcb_attribute_copy_all(&poly->Attributes, &line->Attributes); + + pcb_line_free(line); + } + else { + /* copy the line */ + linelist_remove(line); + linelist_append(&dst->Line, line); + PCB_SET_PARENT(line, layer, dst); + PCB_FLAG_CLEAR(PCB_FLAG_WARN | PCB_FLAG_FOUND | PCB_FLAG_SELECTED, line); + } } while((arc = arclist_first(&src->Arc)) != NULL) {