Index: trunk/src/buffer.c =================================================================== --- trunk/src/buffer.c (revision 17087) +++ trunk/src/buffer.c (revision 17088) @@ -423,7 +423,7 @@ PCB_PADSTACK_LOOP(Buffer->Data); { - pcb_pstk_mirror(padstack, 0, 1); + pcb_pstk_mirror(padstack, 0, 1, 0); } PCB_END_LOOP; PCB_LINE_ALL_LOOP(Buffer->Data); Index: trunk/src/data.c =================================================================== --- trunk/src/data.c (revision 17087) +++ trunk/src/data.c (revision 17088) @@ -323,7 +323,7 @@ { PCB_PADSTACK_LOOP(data); { - pcb_pstk_mirror(padstack, y_offs, pstk_smirror); + pcb_pstk_mirror(padstack, y_offs, pstk_smirror, 0); } PCB_END_LOOP; PCB_SUBC_LOOP(data); Index: trunk/src/obj_pstk.c =================================================================== --- trunk/src/obj_pstk.c (revision 17087) +++ trunk/src/obj_pstk.c (revision 17088) @@ -847,13 +847,17 @@ *err_minhole = proto->hdia; } -void pcb_pstk_mirror(pcb_pstk_t *ps, pcb_coord_t y_offs, int swap_side) +void pcb_pstk_mirror(pcb_pstk_t *ps, pcb_coord_t y_offs, int swap_side, int disable_xmirror) { int xmirror = !ps->xmirror, smirror = (swap_side ? (!ps->smirror) : ps->smirror); + /* change the mirror flag - this will automatically cause mirroring in every aspect */ - pcb_pstk_change_instance(ps, NULL, NULL, NULL, &xmirror, &smirror); + if (disable_xmirror) + pcb_pstk_change_instance(ps, NULL, NULL, NULL, NULL, &smirror); + else + pcb_pstk_change_instance(ps, NULL, NULL, NULL, &xmirror, &smirror); /* if mirror center is not 0, also move, to emulate that the mirror took place around that point */ Index: trunk/src/obj_pstk.h =================================================================== --- trunk/src/obj_pstk.h (revision 17087) +++ trunk/src/obj_pstk.h (revision 17088) @@ -187,8 +187,11 @@ void pcb_pstk_proto_del_shape(pcb_pstk_proto_t *proto, pcb_layer_type_t lyt, pcb_layer_combining_t comb); void pcb_pstk_proto_del_shape_idx(pcb_pstk_proto_t *proto, int idx); -/* Mirror a padstack (useful for sending to the other side - set swap_side to 1 in that case) */ -void pcb_pstk_mirror(pcb_pstk_t *ps, pcb_coord_t y_offs, int swap_side); +/* Mirror a padstack (useful for sending to the other side - set swap_side to 1 in that case) + Disabling xmirror is useful if side needs to be swapped but coordinates + are already mirrored so they represent the other-side geometry (e.g. when + importing from old pcb formats) */ +void pcb_pstk_mirror(pcb_pstk_t *ps, pcb_coord_t y_offs, int swap_side, int disable_xmirror); /* Rotate in place (op wrapper) */ void pcb_pstk_rotate90(pcb_pstk_t *pstk, pcb_coord_t cx, pcb_coord_t cy, int steps); Index: trunk/src_plugins/io_lihata/read.c =================================================================== --- trunk/src_plugins/io_lihata/read.c (revision 17087) +++ trunk/src_plugins/io_lihata/read.c (revision 17088) @@ -1076,7 +1076,7 @@ pcb_attribute_put(&ps->Attributes, "name", Name); if (subc_on_bottom) - pcb_pstk_mirror(ps, 0, 1); + pcb_pstk_mirror(ps, 0, 1, 0); return err; } @@ -1114,7 +1114,7 @@ pcb_attribute_put(&p->Attributes, "name", Name); if (subc_on_bottom) - pcb_pstk_mirror(p, 0, 1); + pcb_pstk_mirror(p, 0, 1, 0); parse_id(&p->ID, obj, 4); pcb_attrib_compat_set_intconn(&p->Attributes, intconn); Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 17087) +++ trunk/src_plugins/io_pcb/file.c (revision 17088) @@ -1021,7 +1021,7 @@ pcb_attribute_put(&p->Attributes, "name", Name); if (yysubc_bottom) - pcb_pstk_mirror(p, 0, 1); + pcb_pstk_mirror(p, 0, 1, 0); return p; } @@ -1038,7 +1038,7 @@ if (yysubc_bottom) { pcb_data_t *old_hack = pcb_pstk_data_hack; pcb_pstk_data_hack = subc->parent.data; - pcb_pstk_mirror(p, 0, 1); + pcb_pstk_mirror(p, 0, 1, 1); pcb_pstk_data_hack = old_hack; }