Index: trunk/src/obj_common.c =================================================================== --- trunk/src/obj_common.c (revision 28732) +++ trunk/src/obj_common.c (revision 28733) @@ -124,7 +124,7 @@ return ID++; } -void pcb_obj_add_attribs(void *obj, const pcb_attribute_list_t *src) +void pcb_obj_add_attribs(void *obj, const pcb_attribute_list_t *src, pcb_bool smart) { pcb_any_obj_t *o = obj; if (src == NULL) Index: trunk/src/obj_common.h =================================================================== --- trunk/src/obj_common.h (revision 28732) +++ trunk/src/obj_common.h (revision 28733) @@ -166,7 +166,10 @@ void pcb_create_ID_reset(void); long int pcb_create_ID_get(void); -void pcb_obj_add_attribs(void *obj, const pcb_attribute_list_t *src); +/* Copy src attributes into obj's attributes, overwriting anything. If smart + is true, be smart about extobj and other attribute side effects + (some of those will not be copied or will be changed) */ +void pcb_obj_add_attribs(void *obj, const pcb_attribute_list_t *src, pcb_bool smart); /* --------------------------------------------------------------------------- * Do not change the following definitions even if they're not very Index: trunk/src/route.c =================================================================== --- trunk/src/route.c (revision 28732) +++ trunk/src/route.c (revision 28733) @@ -471,7 +471,7 @@ p_route->flags); if (line) { pcb_added_lines++; - pcb_obj_add_attribs(line, PCB->pen_attr); + pcb_obj_add_attribs(line, PCB->pen_attr, pcb_true); pcb_line_invalidate_draw(layer, line); pcb_undo_add_obj_to_create(PCB_OBJ_LINE, layer, line, line); applied = 1; @@ -494,7 +494,7 @@ p_route->flags, pcb_true); if (arc) { pcb_added_lines++; - pcb_obj_add_attribs(arc, PCB->pen_attr); + pcb_obj_add_attribs(arc, PCB->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_ARC, layer, arc, arc); pcb_arc_invalidate_draw(layer, arc); applied = 1; @@ -596,7 +596,7 @@ p_route->flags, pcb_true); if (arc) { pcb_added_lines++; - pcb_obj_add_attribs(arc, PCB->pen_attr); + pcb_obj_add_attribs(arc, PCB->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_ARC, layer, arc, arc); pcb_arc_invalidate_draw(layer, arc); applied = 1; @@ -617,7 +617,7 @@ p_route->flags); if (line) { pcb_added_lines++; - pcb_obj_add_attribs(line, PCB->pen_attr); + pcb_obj_add_attribs(line, PCB->pen_attr, pcb_true); pcb_line_invalidate_draw(layer, line); pcb_undo_add_obj_to_create(PCB_OBJ_LINE, layer, line, line); applied = 1; Index: trunk/src/tool_arc.c =================================================================== --- trunk/src/tool_arc.c (revision 28732) +++ trunk/src/tool_arc.c (revision 28733) @@ -116,7 +116,7 @@ conf_core.design.line_thickness, 2 * conf_core.design.clearance, pcb_flag_make(conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0), pcb_true))) { - pcb_obj_add_attribs(arc, pcb->pen_attr); + pcb_obj_add_attribs(arc, pcb->pen_attr, pcb_true); pcb_arc_get_end(arc, 1, &pcb_crosshair.AttachedBox.Point2.X, &pcb_crosshair.AttachedBox.Point2.Y); pcb_crosshair.AttachedBox.Point1.X = pcb_crosshair.AttachedBox.Point2.X; pcb_crosshair.AttachedBox.Point1.Y = pcb_crosshair.AttachedBox.Point2.Y; Index: trunk/src/tool_line.c =================================================================== --- trunk/src/tool_line.c (revision 28732) +++ trunk/src/tool_line.c (revision 28733) @@ -198,7 +198,7 @@ pcb_crosshair.AttachedLine.Point1.Y, conf_core.design.via_drilling_hole, conf_core.design.via_thickness, conf_core.design.clearance, 0, PCB_PSTK_COMPAT_ROUND, pcb_true)) != NULL)) { - pcb_obj_add_attribs(ps, pcb->pen_attr); + pcb_obj_add_attribs(ps, pcb->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_PSTK, ps, ps, ps); } @@ -269,7 +269,7 @@ pcb_pstk_t *ps = NULL; pcb_added_lines++; - pcb_obj_add_attribs(line, pcb->pen_attr); + pcb_obj_add_attribs(line, pcb->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_LINE, PCB_CURRLAYER(pcb), line, line); pcb_line_invalidate_draw(PCB_CURRLAYER(pcb), line); /* place a via if vias are visible, the layer is @@ -290,7 +290,7 @@ pcb_crosshair.AttachedLine.Point1.Y, conf_core.design.via_drilling_hole, conf_core.design.via_thickness, conf_core.design.clearance, 0, PCB_PSTK_COMPAT_ROUND, pcb_true)) != NULL)) { - pcb_obj_add_attribs(ps, pcb->pen_attr); + pcb_obj_add_attribs(ps, pcb->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_PSTK, ps, ps, ps); pcb_pstk_invalidate_draw(ps); } @@ -312,7 +312,7 @@ pcb_flag_make((conf_core.editor.auto_drc ? PCB_FLAG_FOUND : 0) | (conf_core.editor.clear_line ? PCB_FLAG_CLEARLINE : 0)))) != NULL) { pcb_added_lines++; - pcb_obj_add_attribs(line, pcb->pen_attr); + pcb_obj_add_attribs(line, pcb->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_LINE, PCB_CURRLAYER(pcb), line, line); pcb_undo_inc_serial(); pcb_line_invalidate_draw(PCB_CURRLAYER(pcb), line); Index: trunk/src/tool_rectangle.c =================================================================== --- trunk/src/tool_rectangle.c (revision 28732) +++ trunk/src/tool_rectangle.c (revision 28733) @@ -80,7 +80,7 @@ pcb_crosshair.AttachedBox.Point2.Y, 2 * conf_core.design.clearance, pcb_flag_make(flags))) != NULL) { - pcb_obj_add_attribs(polygon, pcb->pen_attr); + pcb_obj_add_attribs(polygon, pcb->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_POLY, layer, polygon, polygon); pcb_undo_inc_serial(); pcb_poly_invalidate_draw(layer, polygon); Index: trunk/src/tool_via.c =================================================================== --- trunk/src/tool_via.c (revision 28732) +++ trunk/src/tool_via.c (revision 28733) @@ -73,7 +73,7 @@ if (ps == NULL) return; - pcb_obj_add_attribs(ps, pcb->pen_attr); + pcb_obj_add_attribs(ps, pcb->pen_attr, pcb_true); pcb_undo_add_obj_to_create(PCB_OBJ_PSTK, ps, ps, ps); if (pcb_gui->shift_is_pressed(pcb_gui))