diff --git a/src/hilight.c b/src/hilight.c index 130930c9..eb832c3b 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -991,12 +991,12 @@ void draw_hilight_net(int on_window) { int save_draw; int i,c; - struct hilight_hashentry *entry; double x1,y1,x2,y2; xSymbol *symptr; int use_hash; struct wireentry *wireptr; struct instentry *instanceptr; + struct hilight_hashentry *entry; if(!xctx->hilight_nets) return; dbg(3, "draw_hilight_net(): xctx->prep_hi_structs=%d\n", xctx->prep_hi_structs); @@ -1045,7 +1045,6 @@ void draw_hilight_net(int on_window) if(use_hash) init_inst_iterator(x1, y1, x2, y2); else i = -1; while(1) { - char *type; if(use_hash) { if( !(instanceptr = inst_iterator_next())) break; i = instanceptr->n; @@ -1054,12 +1053,6 @@ void draw_hilight_net(int on_window) i++; if(i >= xctx->instances) break; } - type = (xctx->inst[i].ptr+ xctx->sym)->type; - /* after an undo xctx->inst[i].color is gone, so rebuild it for labels/pins */ - if( type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) { - entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP); - if(entry) xctx->inst[i].color = get_color(entry->value); - } if(xctx->inst[i].color ) { symptr = (xctx->inst[i].ptr+ xctx->sym); diff --git a/src/netlist.c b/src/netlist.c index c414c1d6..f616ddac 100644 --- a/src/netlist.c +++ b/src/netlist.c @@ -631,6 +631,7 @@ void prepare_netlist_structs(int for_netlist) double rx1,ry1; struct wireentry *wptr; struct instpinentry *iptr; + struct hilight_hashentry *entry; int i,j, rects, generic_rects; char *dir=NULL; char *type=NULL; @@ -1041,6 +1042,16 @@ void prepare_netlist_structs(int for_netlist) my_free(840, &class); my_free(841, &global_node); dbg(2, "prepare_netlist_structs(): returning\n"); + + if(xctx->hilight_nets) for(i=0;iinstances;i++){ + /* after an undo/load/hierarchy descend/return + * xctx->inst[i].color is gone, so rebuild it for labels/pins */ + char *type = (xctx->inst[i].ptr+ xctx->sym)->type; + if(type && xctx->inst[i].color == 0 && IS_LABEL_SH_OR_PIN(type) ) { + entry=bus_hilight_lookup(xctx->inst[i].lab, 0, XLOOKUP); + if(entry) xctx->inst[i].color = get_color(entry->value); + } + } } int sym_vs_sch_pins()