Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 14269) +++ trunk/src/obj_subc.c (revision 14270) @@ -1357,6 +1357,17 @@ return chgly; } +void pcb_subc_bind_globals(pcb_board_t *pcb, pcb_subc_t *subc) +{ + if (pcb->Data->via_tree == NULL) + pcb->Data->via_tree = pcb_r_create_tree(); + subc->data->via_tree = pcb->Data->via_tree; + if (pcb->Data->padstack_tree == NULL) + pcb->Data->padstack_tree = pcb_r_create_tree(); + subc->data->padstack_tree = pcb->Data->padstack_tree; +#warning subc TODO: subc-in-subc: bind subc rtree +} + void *pcb_subcop_change_size(pcb_opctx_t *ctx, pcb_subc_t *sc) { pcb_subc_op(ctx->chgsize.pcb->Data, sc, &ChangeSizeFunctions, ctx); Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 14269) +++ trunk/src/obj_subc.h (revision 14270) @@ -84,9 +84,12 @@ void XORDrawSubc(pcb_subc_t *sc, pcb_coord_t DX, pcb_coord_t DY, int use_curr_side); -/* Redo the binding after the layer binding recipe changed in sc */ +/* Redo the layer binding after the layer binding recipe changed in sc */ int pcb_subc_rebind(pcb_board_t *pcb, pcb_subc_t *sc); +/* Do the initial global bindings of subc to pcb (rtree links) */ +void pcb_subc_bind_globals(pcb_board_t *pcb, pcb_subc_t *subc); + #include "rtree.h" pcb_r_dir_t draw_subc_mark_callback(const pcb_box_t *b, void *cl); void DrawSubc(pcb_subc_t *sc);