Index: trunk/src/obj_pstk.c =================================================================== --- trunk/src/obj_pstk.c (revision 30052) +++ trunk/src/obj_pstk.c (revision 30053) @@ -1248,7 +1248,6 @@ void pcb_pstk_scale(pcb_pstk_t *ps, double sx, double sy, int undoable) { pcb_pstk_proto_t *prt; - pcb_pstk_tshape_t *tshp; int n; if ((sx == 1.0) && (sy == 1.0)) @@ -1260,9 +1259,8 @@ pcb_pstk_proto_copy(prt, pcb_pstk_get_proto(ps)); /* after the copy we have the canonical transformed shape only; scale each shape in it */ - tshp = &prt->tr.array[0]; - for(n = 0; n < tshp->len; n++) - pcb_pstk_shape_scale(&tshp->shape[n], sx, sy, undoable); + for(n = 0; n < prt->tr.array[0].len; n++) + pcb_pstk_shape_scale(prt, 0, n, sx, sy, undoable); if (prt->hdia > 0.0) prt->hdia = pcb_round((double)prt->hdia * ((sx+sy)/2.0)); Index: trunk/src/obj_pstk.h =================================================================== --- trunk/src/obj_pstk.h (revision 30052) +++ trunk/src/obj_pstk.h (revision 30053) @@ -199,9 +199,10 @@ /* grow (or shrink) a prototype to or by val - change the proto in place */ void pcb_pstk_proto_grow(pcb_pstk_proto_t *proto, pcb_bool is_absolute, pcb_coord_t val); -void pcb_pstk_shape_grow(pcb_pstk_shape_t *shp, pcb_bool is_absolute, pcb_coord_t val); +void pcb_pstk_shape_grow_(pcb_pstk_shape_t *shp, pcb_bool is_absolute, pcb_coord_t val); +void pcb_pstk_shape_grow(pcb_pstk_proto_t *proto, int tridx, int shpidx, pcb_bool is_absolute, pcb_coord_t val, int undoable); void pcb_pstk_shape_clr_grow(pcb_pstk_shape_t *shp, pcb_bool is_absolute, pcb_coord_t val, int undoable); -void pcb_pstk_shape_scale(pcb_pstk_shape_t *shp, double sx, double sy, int undoable); +void pcb_pstk_shape_scale(pcb_pstk_proto_t *proto, int tridx, int shpidx, double sx, double sy, int undoable); /* Derive (copy and bloat) the shape at dst_idx from src_idx; set the mask and comb for the new shape. If dst_idx is -1, allocate the new shape */ Index: trunk/src/obj_pstk_proto.c =================================================================== --- trunk/src/obj_pstk_proto.c (revision 30052) +++ trunk/src/obj_pstk_proto.c (revision 30053) @@ -1108,13 +1108,11 @@ *cy = pcb_round(y); } -void pcb_pstk_shape_grow(pcb_pstk_shape_t *shp, pcb_bool is_absolute, pcb_coord_t val) +void pcb_pstk_shape_grow_(pcb_pstk_shape_t *shp, pcb_bool is_absolute, pcb_coord_t val) { pcb_coord_t cx, cy; int n; -TODO("padstack: undo") - switch(shp->shape) { case PCB_PSSH_LINE: if (is_absolute) @@ -1171,13 +1169,20 @@ } } -void pcb_pstk_shape_scale(pcb_pstk_shape_t *shp, double sx, double sy, int undoable) +void pcb_pstk_shape_grow(pcb_pstk_proto_t *proto, int tridx, int shpidx, pcb_bool is_absolute, pcb_coord_t val, int undoable) { + pcb_pstk_tshape_t *tshp = &proto->tr.array[tridx]; + pcb_pstk_shape_t *shp = &tshp->shape[shpidx]; + + TODO("undo"); + pcb_pstk_shape_grow_(shp, is_absolute, val); +} + +static void pcb_pstk_shape_scale_(pcb_pstk_shape_t *shp, double sx, double sy) +{ pcb_coord_t cx, cy; int n; -TODO("padstack: undo") - switch(shp->shape) { case PCB_PSSH_LINE: shp->data.line.thickness = pcb_round(shp->data.line.thickness * ((sx+sy)/2.0)); @@ -1210,6 +1215,16 @@ } } +void pcb_pstk_shape_scale(pcb_pstk_proto_t *proto, int tridx, int shpidx, double sx, double sy, int undoable) +{ + pcb_pstk_tshape_t *tshp = &proto->tr.array[tridx]; + pcb_pstk_shape_t *shp = &tshp->shape[shpidx]; + + TODO("padstack: undo") + + pcb_pstk_shape_scale_(shp, sx, sy); +} + void pcb_pstk_shape_clr_grow(pcb_pstk_shape_t *shp, pcb_bool is_absolute, pcb_coord_t val, int undoable) { TODO("padstack: undo") @@ -1221,12 +1236,12 @@ void pcb_pstk_proto_grow(pcb_pstk_proto_t *proto, pcb_bool is_absolute, pcb_coord_t val) { - int n, i; + int n, i, undoable = 0;; /* do the same growth on all shapes of all transformed variants */ for(n = 0; n < proto->tr.used; n++) for(i = 0; i < proto->tr.array[n].len; i++) - pcb_pstk_shape_grow(&proto->tr.array[n].shape[i], is_absolute, val); + pcb_pstk_shape_grow(proto, n, i, is_absolute, val, undoable); pcb_pstk_proto_update(proto); } @@ -1240,7 +1255,7 @@ void pcb_pstk_shape_derive(pcb_pstk_proto_t *proto, int dst_idx, int src_idx, pcb_coord_t bloat, pcb_layer_type_t mask, pcb_layer_combining_t comb) { - int n; + int n, undoable = 0; /* do the same copy on all shapes of all transformed variants */ for(n = 0; n < proto->tr.used; n++) { @@ -1253,7 +1268,7 @@ proto->tr.array[n].shape[d].layer_mask = mask; proto->tr.array[n].shape[d].comb = comb; if (bloat != 0) - pcb_pstk_shape_grow(&proto->tr.array[n].shape[d], pcb_false, bloat); + pcb_pstk_shape_grow(proto, n, d, pcb_false, bloat, undoable); } pcb_pstk_proto_update(proto); } Index: trunk/src_plugins/dialogs/dlg_padstack.c =================================================================== --- trunk/src_plugins/dialogs/dlg_padstack.c (revision 30052) +++ trunk/src_plugins/dialogs/dlg_padstack.c (revision 30053) @@ -533,7 +533,7 @@ bloat *= sign; for(n = 0; n < proto->tr.used; n++) - pcb_pstk_shape_grow(&proto->tr.array[n].shape[dst_idx], pcb_false, bloat); + pcb_pstk_shape_grow(proto, n, dst_idx, pcb_false, bloat, 1); pcb_pstk_proto_update(proto); Index: trunk/src_plugins/io_dsn/read.c =================================================================== --- trunk/src_plugins/io_dsn/read.c (revision 30052) +++ trunk/src_plugins/io_dsn/read.c (revision 30053) @@ -619,7 +619,7 @@ aper = COORD(ctx, ap); if (aper > 0) - pcb_pstk_shape_grow(shp, 0, aper); + pcb_pstk_shape_grow_(shp, 0, aper); pcb_pstk_shape_update_pa(&shp->data.poly);