Index: trunk/src/libcschem/cnc_arc.c =================================================================== --- trunk/src/libcschem/cnc_arc.c (revision 2273) +++ trunk/src/libcschem/cnc_arc.c (revision 2274) @@ -294,13 +294,13 @@ csch_arc_modify(sheet, arc, &ncx, &ncy, NULL, &nstart, &ndelta, undoable, 0); } -static void arc_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, int undoable) +static void arc_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, const csch_chdr_t *in, int undoable) { - csch_arc_t *arc = (csch_arc_t *)obj; + csch_arc_t *arc = (csch_arc_t *)in; csch_coord_t cx = arc->inst.c.c.x, cy = arc->inst.c.c.y, r = arc->inst.c.r; double start = arc->inst.c.start, delta = arc->inst.c.delta; - csch_arc_modify(sheet, arc, &cx, &cy, &r, &start, &delta, undoable, 0); + csch_arc_modify(sheet, (csch_arc_t *)obj, &cx, &cy, &r, &start, &delta, undoable, 0); } Index: trunk/src/libcschem/cnc_line.c =================================================================== --- trunk/src/libcschem/cnc_line.c (revision 2273) +++ trunk/src/libcschem/cnc_line.c (revision 2274) @@ -248,13 +248,13 @@ } -static void line_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, int undoable) +static void line_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, const csch_chdr_t *in, int undoable) { - csch_line_t *line = (csch_line_t *)obj; + csch_line_t *line = (csch_line_t *)in; csch_coord_t x1 = line->inst.c.p1.x, y1 = line->inst.c.p1.y; csch_coord_t x2 = line->inst.c.p2.x, y2 = line->inst.c.p2.y; - csch_line_modify(sheet, line, &x1, &y1, &x2, &y2, undoable, 0); + csch_line_modify(sheet, (csch_line_t *)obj, &x1, &y1, &x2, &y2, undoable, 0); } const csch_ops_t csch_ops_line = { Index: trunk/src/libcschem/cnc_text.c =================================================================== --- trunk/src/libcschem/cnc_text.c (revision 2273) +++ trunk/src/libcschem/cnc_text.c (revision 2274) @@ -287,14 +287,14 @@ csch_text_modify(sheet, text, &x1, &y1, &x2, &y2, &nrot, NULL, NULL, NULL, NULL, undoable, 0); } -static void text_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, int undoable) +static void text_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, const csch_chdr_t *in, int undoable) { - csch_text_t *text = (csch_text_t *)obj; + csch_text_t *text = (csch_text_t *)in; csch_coord_t x1 = text->inst1.x, y1 = text->inst1.y; csch_coord_t x2 = text->inst2.x, y2 = text->inst2.y; double rot = text->inst_rot; - csch_text_modify(sheet, text, &x1, &y1, &x2, &y2, &rot, NULL, NULL, NULL, NULL, undoable, 0); + csch_text_modify(sheet, (csch_text_t *)obj, &x1, &y1, &x2, &y2, &rot, NULL, NULL, NULL, NULL, undoable, 0); } const csch_ops_t csch_ops_text = { Index: trunk/src/libcschem/operation.c =================================================================== --- trunk/src/libcschem/operation.c (revision 2273) +++ trunk/src/libcschem/operation.c (revision 2274) @@ -175,12 +175,12 @@ } } -void csch_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, int undoable) +void csch_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, const csch_chdr_t *inst_from, int undoable) { const csch_ops_t *op = csch_op_get(obj->type); if ((op != NULL) && (op->inst2spec != NULL)) { uundo_freeze_serial(&sheet->undo); - op->inst2spec(sheet, obj, undoable); + op->inst2spec(sheet, obj, inst_from, undoable); uundo_unfreeze_serial(&sheet->undo); uundo_inc_serial(&sheet->undo); } Index: trunk/src/libcschem/operation.h =================================================================== --- trunk/src/libcschem/operation.h (revision 2273) +++ trunk/src/libcschem/operation.h (revision 2274) @@ -50,7 +50,7 @@ void (*rotate)(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t rcx, csch_coord_t rcy, double da, int undoable); void (*rotate90)(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t rcx, csch_coord_t rcy, int n, int undoable); void (*mirror)(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t mcx, csch_coord_t mcy, int mirx, int miry, int undoable); - void (*inst2spec)(csch_sheet_t *sheet, csch_chdr_t *obj, int undoable); + void (*inst2spec)(csch_sheet_t *sheet, csch_chdr_t *obj, const csch_chdr_t *in, int undoable); } csch_ops_t; @@ -70,9 +70,9 @@ void csch_move(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t dx, csch_coord_t dy, int undoable); void csch_copy(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t dx, csch_coord_t dy, int undoable); -/* Copy inst (current final transformation) back to spec; this can be used - in a transformed group breakup to get all ex-member objects stay in place */ -void csch_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, int undoable); +/* Copy inst (current final transformation) of inst_from to spec of obj; this + can be used in a transformed group breakup to get all ex-member objects stay in place. */ +void csch_inst2spec(csch_sheet_t *sheet, csch_chdr_t *obj, const csch_chdr_t *inst_from, int undoable); /* Undoably rotate object by da radians around rcx;rcy; the original spec is moved */ void csch_rotate(csch_sheet_t *sheet, csch_chdr_t *obj, csch_coord_t rcx, csch_coord_t rcy, double da, int undoable); Index: trunk/src/plugins/construct/breakup.c =================================================================== --- trunk/src/plugins/construct/breakup.c (revision 2273) +++ trunk/src/plugins/construct/breakup.c (revision 2274) @@ -41,7 +41,7 @@ for(e = htip_first(&src->id2obj); e != NULL; e = htip_next(&src->id2obj, e)) { csch_chdr_t *newo = csch_op_copy_into(sheet, dst, e->value); if (newo != NULL) - csch_move(sheet, newo, src->x, src->y, 1); + csch_inst2spec(sheet, newo, e->value, 1); else res = -1; }