Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 12490) +++ trunk/src/draw.c (revision 12491) @@ -422,12 +422,13 @@ pcb_gui->render_burst(PCB_HID_BURST_END, drawn_area); } -static void pcb_draw_padstacks(pcb_layergrp_id_t group, const pcb_box_t *drawn_area, int is_current) +static void pcb_draw_padstacks(pcb_layergrp_id_t group, const pcb_box_t *drawn_area, int is_current, pcb_layer_combining_t comb) { pcb_padstack_draw_t ctx; ctx.pcb = PCB; ctx.gid = group; ctx.is_current = is_current; + ctx.comb = comb; pcb_r_search(PCB->Data->padstack_tree, drawn_area, NULL, pcb_padstack_draw_callback, &ctx, NULL); } @@ -621,7 +622,7 @@ pcb_draw_ppv(group, drawn_area); if (gflg & PCB_LYT_COPPER) - pcb_draw_padstacks(group, drawn_area, is_current); + pcb_draw_padstacks(group, drawn_area, is_current, PCB_LYC_AUTO); pcb_gui->set_drawing_mode(PCB_HID_COMP_FLUSH, Output.direct, drawn_area); } Index: trunk/src/obj_padstack.c =================================================================== --- trunk/src/obj_padstack.c (revision 12490) +++ trunk/src/obj_padstack.c (revision 12491) @@ -236,8 +236,7 @@ pcb_padstack_t *ps = (pcb_padstack_t *)b; pcb_padstack_shape_t *shape; -#warning padstack TODO: comb should not be 0 - draw both add and sub! - shape = pcb_padstack_shape_gid(ctx->pcb, ps, ctx->gid); + shape = pcb_padstack_shape_gid(ctx->pcb, ps, ctx->gid, (ctx->comb & ~PCB_LYC_AUTO)); if (shape != NULL) { pcb_gui->set_draw_xor(Output.fgGC, 0); switch(shape->shape) { @@ -303,7 +302,9 @@ pcb = pcb_data_get_top(ps->parent.data); if (pcb != NULL) { - shape = pcb_padstack_shape_gid(pcb, ps, gid); + shape = pcb_padstack_shape_gid(pcb, ps, gid, 0); + if (shape == NULL) + shape = pcb_padstack_shape_gid(pcb, ps, gid, PCB_LYC_SUB); } else { /* no pcb means buffer - take the first shape */ pcb_padstack_proto_t *proto = pcb_padstack_get_proto(ps); Index: trunk/src/obj_padstack_draw.h =================================================================== --- trunk/src/obj_padstack_draw.h (revision 12490) +++ trunk/src/obj_padstack_draw.h (revision 12491) @@ -35,6 +35,7 @@ pcb_board_t *pcb; pcb_layergrp_id_t gid; int is_current; + pcb_layer_combining_t comb; } pcb_padstack_draw_t; pcb_r_dir_t pcb_padstack_draw_callback(const pcb_box_t *b, void *cl); Index: trunk/src/obj_padstack_inlines.h =================================================================== --- trunk/src/obj_padstack_inlines.h (revision 12490) +++ trunk/src/obj_padstack_inlines.h (revision 12491) @@ -136,7 +136,7 @@ static inline PCB_FUNC_UNUSED pcb_padstack_shape_t *pcb_padstack_shape_at(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layer_t *layer) { unsigned int lyt = pcb_layer_flags_(layer); - pcb_layer_combining_t comb = 0; + pcb_layer_combining_t comb = layer->comb; if (lyt & PCB_LYT_COPPER) { pcb_layer_id_t lid; @@ -166,7 +166,7 @@ return pcb_padstack_shape(ps, lyt, comb); } -static inline PCB_FUNC_UNUSED pcb_padstack_shape_t *pcb_padstack_shape_gid(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t gid) +static inline PCB_FUNC_UNUSED pcb_padstack_shape_t *pcb_padstack_shape_gid(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t gid, pcb_layer_combining_t comb) { pcb_layergrp_t *grp = pcb_get_layergrp(pcb, gid); @@ -186,7 +186,7 @@ } /* normal procedure: go by group flags */ - return pcb_padstack_shape(ps, grp->type, 0); + return pcb_padstack_shape(ps, grp->type, comb); }