Index: trunk/src/obj_subc.c =================================================================== --- trunk/src/obj_subc.c (revision 16986) +++ trunk/src/obj_subc.c (revision 16987) @@ -1714,3 +1714,15 @@ sc->data->Layer[n].type = PCB_OBJ_LAYER; return &sc->data->Layer[n]; } + +void pcb_subc_part_changed_(pcb_any_obj_t *obj) +{ + pcb_subc_t *sc = pcb_obj_parent_subc(obj); + if (sc == NULL) + return; + + /* can't do this incrementally: if a boundary object is smaller than before + it has to make the subc bbox smaller too */ + pcb_subc_bbox(sc); +} + Index: trunk/src/obj_subc.h =================================================================== --- trunk/src/obj_subc.h (revision 16986) +++ trunk/src/obj_subc.h (revision 16987) @@ -125,6 +125,10 @@ /* Returns whether there's no object in the subc */ pcb_bool pcb_subc_is_empty(pcb_subc_t *subc); +/* Update the subcircuit (e.g. bbox) after a part of the subcircuit has changed */ +void pcb_subc_part_changed_(pcb_any_obj_t *obj); +#define pcb_subc_part_changed(obj) pcb_subc_part_changed_((pcb_any_obj_t *)obj) + /*** subc creation helpers ***/ /* Create the aux layer for a subc, set origin to ox;oy and rotation to rot */