Index: obj_pstk_proto.c =================================================================== --- obj_pstk_proto.c (revision 30052) +++ 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); }