Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 14183) +++ trunk/src/obj_subc.c (revision 14184) @@ -325,7 +325,7 @@ sc->aux_layer = pcb_layer_new_bound(sc->data, PCB_LYT_VIRTUAL | PCB_LYT_NOEXPORT | PCB_LYT_MISC | PCB_LYT_TOP, SUBC_AUX_NAME); } -void pcb_subc_create_aux(pcb_subc_t *sc, pcb_coord_t ox, pcb_coord_t oy, double rot) +void pcb_subc_create_aux(pcb_subc_t *sc, pcb_coord_t ox, pcb_coord_t oy, double rot, pcb_bool bottom) { double unit = PCB_MM_TO_COORD(1); double cs, sn; @@ -341,6 +341,12 @@ sn = sin(rot/PCB_RAD_TO_DEG); } + if (bottom) { + assert(sc->aux_layer->is_bound); + sc->aux_layer->meta.bound.type &= ~PCB_LYT_TOP; + sc->aux_layer->meta.bound.type |= PCB_LYT_BOTTOM; + } + add_aux_line(sc->aux_layer, "subc-role", "origin", ox, oy, ox, oy); add_aux_line(sc->aux_layer, "subc-role", "x", ox, oy, pcb_round((double)ox + cs*unit), pcb_round(oy + sn*unit)); add_aux_line(sc->aux_layer, "subc-role", "y", ox, oy, pcb_round((double)ox + sn*unit), pcb_round(oy + cs*unit)); @@ -574,7 +580,7 @@ vtp0_uninit(&mask_pads); vtp0_uninit(&paste_pads); - pcb_subc_create_aux(sc, buffer->X, buffer->Y, 0.0); + pcb_subc_create_aux(sc, buffer->X, buffer->Y, 0.0, pcb_false); /* Add refdes */ pcb_attribute_put(&sc->Attributes, "refdes", "U0"); Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 14183) +++ trunk/src/obj_subc.h (revision 14184) @@ -117,7 +117,7 @@ /*** subc creation helpers ***/ /* Create the aux layer for a subc, set origin to ox;oy and rotation to rot */ -void pcb_subc_create_aux(pcb_subc_t *sc, pcb_coord_t ox, pcb_coord_t oy, double rot); +void pcb_subc_create_aux(pcb_subc_t *sc, pcb_coord_t ox, pcb_coord_t oy, double rot, pcb_bool bottom); /* Create a new point on the aux layer using a given role string in attribute */ void pcb_subc_create_aux_point(pcb_subc_t *sc, pcb_coord_t x, pcb_coord_t y, const char *role); Index: trunk/src_plugins/io_pcb/file.c =================================================================== --- trunk/src_plugins/io_pcb/file.c (revision 14183) +++ trunk/src_plugins/io_pcb/file.c (revision 14184) @@ -1138,7 +1138,7 @@ /* add the base vector at the origin imported, but with the rotation reverse engineered: the original element format does have an explicit origin but no rotation info */ - pcb_subc_create_aux(yysubc, yysubc_ox, yysubc_oy, rot); + pcb_subc_create_aux(yysubc, yysubc_ox, yysubc_oy, rot, yysubc_bottom); pcb_add_subc_to_data(Data, yysubc); if (Data->subc_tree == NULL) Index: trunk/src_plugins/io_tedax/footprint.c =================================================================== --- trunk/src_plugins/io_tedax/footprint.c (revision 14183) +++ trunk/src_plugins/io_tedax/footprint.c (revision 14184) @@ -641,7 +641,7 @@ pcb_attribute_put(&subc->Attributes, "refdes", "X1"); pcb_subc_add_refdes_text(subc, 0, 0, 0, 100, pcb_false); - pcb_subc_create_aux(subc, 0, 0, 0.0); + pcb_subc_create_aux(subc, 0, 0, 0.0, pcb_false); return res; }