Index: trunk/src/drc.h =================================================================== --- trunk/src/drc.h (revision 21169) +++ trunk/src/drc.h (revision 21170) @@ -78,4 +78,7 @@ /* Slow, linear search for an UID in a list; returns NULL if not found */ pcb_drc_violation_t *pcb_drc_by_uid(const pcb_drc_list_t *lst, unsigned long int uid); +/* Zoom the drawing area to the drc error */ +void pcb_drc_goto(pcb_drc_violation_t *item); + #endif Index: trunk/src/drc_list.c =================================================================== --- trunk/src/drc_list.c (revision 21169) +++ trunk/src/drc_list.c (revision 21170) @@ -25,11 +25,18 @@ * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") * */ +#include "config.h" #define TDL_DONT_UNDEF #include "drc.h" #include +#undef TDL_DONT_UNDEF +#include + +#include "actions.h" + + void pcb_drc_free(pcb_drc_violation_t *item) { pcb_drc_list_remove(item); @@ -64,3 +71,17 @@ return NULL; } + +void pcb_drc_goto(pcb_drc_violation_t *item) +{ + if (item->have_coord) { + fgw_arg_t res, argv[5]; + + argv[1].type = FGW_COORD; fgw_coord(&argv[1]) = item->bbox.X1; + argv[2].type = FGW_COORD; fgw_coord(&argv[2]) = item->bbox.Y1; + argv[3].type = FGW_COORD; fgw_coord(&argv[3]) = item->bbox.X2; + argv[4].type = FGW_COORD; fgw_coord(&argv[4]) = item->bbox.Y2; + pcb_actionv_bin("zoom", &res, 5, argv); + } +} +