Index: trunk/src/draw.c =================================================================== --- trunk/src/draw.c (revision 12252) +++ trunk/src/draw.c (revision 12253) @@ -409,6 +409,14 @@ pcb_r_search(PCB->Data->padstack_tree, drawn_area, NULL, pcb_padstack_draw_callback, &ctx, NULL); } +static void pcb_draw_padstack_holes(pcb_layergrp_id_t group, const pcb_box_t *drawn_area) +{ + pcb_padstack_draw_t ctx; + ctx.pcb = PCB; + ctx.gid = group; + pcb_r_search(PCB->Data->padstack_tree, drawn_area, NULL, pcb_padstack_draw_hole_callback, &ctx, NULL); +} + /* --------------------------------------------------------------------------- * Draws pins pads and vias - Always draws for non-gui HIDs, * otherwise drawing depends on PCB->PinOn and PCB->ViaOn @@ -444,8 +452,10 @@ /* draw padstacks */ - if (PCB->ViaOn || !pcb_gui->gui) + if (PCB->ViaOn || !pcb_gui->gui) { pcb_draw_padstacks(group, drawn_area); + pcb_draw_padstack_holes(group, drawn_area); + } } /* --------------------------------------------------------------------------- Index: trunk/src/obj_pad_draw.h =================================================================== --- trunk/src/obj_pad_draw.h (revision 12252) +++ trunk/src/obj_pad_draw.h (revision 12253) @@ -30,6 +30,7 @@ /* Include rtree.h for these */ #ifdef PCB_RTREE_H pcb_r_dir_t pcb_pad_draw_callback(const pcb_box_t * b, void *cl); +pcb_r_dir_t pcb_padstack_draw_hole_callback(const pcb_box_t *b, void *cl); pcb_r_dir_t pcb_pad_name_draw_callback(const pcb_box_t * b, void *cl); pcb_r_dir_t pcb_pad_clear_callback(const pcb_box_t * b, void *cl); #endif Index: trunk/src/obj_padstack.c =================================================================== --- trunk/src/obj_padstack.c (revision 12252) +++ trunk/src/obj_padstack.c (revision 12253) @@ -160,4 +160,21 @@ pcb_gui->draw_line(Output.fgGC, ps->x, ps->y-PS_CROSS_SIZE/2, ps->x, ps->y+PS_CROSS_SIZE/2); pcb_gui->set_draw_xor(Output.fgGC, 0); + return PCB_R_DIR_FOUND_CONTINUE; } + +pcb_r_dir_t pcb_padstack_draw_hole_callback(const pcb_box_t *b, void *cl) +{ + pcb_padstack_draw_t *ctx = cl; + pcb_padstack_t *ps = (pcb_padstack_t *)b; + pcb_padstack_proto_t *proto; + + if (!pcb_padstack_bb_drills(ctx->pcb, ps, ctx->gid, &proto)) + return PCB_R_DIR_FOUND_CONTINUE; + + pcb_gui->fill_circle(Output.drillGC, ps->x, ps->y, proto->hdia / 2); + + + return PCB_R_DIR_FOUND_CONTINUE; +} + Index: trunk/src/obj_padstack_inlines.h =================================================================== --- trunk/src/obj_padstack_inlines.h (revision 12252) +++ trunk/src/obj_padstack_inlines.h (revision 12253) @@ -40,12 +40,17 @@ return ps->parent.data->ps_protos.array + ps->proto; } -/* return the type of drill and optionally fill in group IDs of drill ends */ -static inline PCB_FUNC_UNUSED pcb_bb_type_t pcb_padstack_bbspan(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t *top, pcb_layergrp_id_t *bottom) +/* return the type of drill and optionally fill in group IDs of drill ends ; + if proto_out is not NULL, also load it with the proto */ +static inline PCB_FUNC_UNUSED pcb_bb_type_t pcb_padstack_bbspan(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t *top, pcb_layergrp_id_t *bottom, pcb_padstack_proto_t **proto_out) { pcb_bb_type_t res; int topi, boti; pcb_padstack_proto_t *proto = pcb_padstack_get_proto(ps); + + if (proto_out != NULL) + *proto_out = proto; + if (proto == NULL) return PCB_BB_INVALID; @@ -92,10 +97,10 @@ /* return whether a given padstack drills a given group (does not consider plating, only drill!) */ -static inline PCB_FUNC_UNUSED pcb_bool_t pcb_padstack_bb_drills(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t grp) +static inline PCB_FUNC_UNUSED pcb_bool_t pcb_padstack_bb_drills(pcb_board_t *pcb, pcb_padstack_t *ps, pcb_layergrp_id_t grp, pcb_padstack_proto_t **proto_out) { pcb_layergrp_id_t top, bot; - pcb_bb_type_t res = pcb_padstack_bbspan(pcb, ps, &top, &bot); + pcb_bb_type_t res = pcb_padstack_bbspan(pcb, ps, &top, &bot, proto_out); switch(res) { case PCB_BB_THRU: return pcb_true; case PCB_BB_NONE: case PCB_BB_INVALID: return 0;