diff --git a/src/actions.c b/src/actions.c index 863b2f67..ff2bc3e6 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1678,6 +1678,7 @@ void new_wire(int what, double mx_snap, double my_snap) if(show_pin_net_names) { int w; prepare_netlist_structs(0); + find_inst_hash_clear(); bbox(BEGIN , 0.0 , 0.0 , 0.0 , 0.0); for(w=savelastwire; wrects[PINLAYER]; k++) { if( inst_ptr[i].node && inst_ptr[i].node[k]) { find_inst_to_be_redrawn(inst_ptr[i].node[k]); @@ -1095,6 +1096,7 @@ void update_symbol(const char *result, int x) if(show_pin_net_names) { prepare_netlist_structs(0); + find_inst_hash_clear(); for(k = 0; k < (inst_ptr[i].ptr + instdef)->rects[PINLAYER]; k++) { if( inst_ptr[i].node && inst_ptr[i].node[k]) { find_inst_to_be_redrawn(inst_ptr[i].node[k]); diff --git a/src/move.c b/src/move.c index 30b456bb..422e2942 100644 --- a/src/move.c +++ b/src/move.c @@ -445,11 +445,21 @@ void draw_selection(GC g, int interruptable) lastsel = i; } +static struct int_hashentry *nodetable[HASHSIZE]; + +void find_inst_hash_clear(void) +{ + free_int_hash(nodetable); +} + void find_inst_to_be_redrawn(const char *node) { int i, p, rects; Instdef * sym; + + if(int_hash_lookup(nodetable, node, 0, XINSERT_NOREPLACE)) return; + for(i=0; i< lastinst; i++) { sym = inst_ptr[i].ptr + instdef; rects = sym->rects[PINLAYER]; @@ -534,7 +544,7 @@ void copy_objects(int what) set_modify(1); push_undo(); /* 20150327 push_undo */ prepared_hash_instances=0; /* 20171224 */ prepared_hash_wires=0; - + if(show_pin_net_names) find_inst_hash_clear(); /* calculate copied symbols bboxes before actually doing the move */ for(i=0;i0 && prepared_netlist_structs) return; /* 20160413 */ else if (!for_netlist && prepared_hilight_structs) return; /* 20171210 */ else delete_netlist_structs(); - here(); if (for_netlist>0) { my_snprintf(nn, S(nn), "-----------%s", schematic[currentsch]); statusmsg(nn,2); diff --git a/src/select.c b/src/select.c index 4217d5e7..93090ca6 100644 --- a/src/select.c +++ b/src/select.c @@ -224,6 +224,7 @@ void delete(void) prepared_netlist_structs=0; prepared_hilight_structs=0; if(show_pin_net_names) { + find_inst_hash_clear(); prepare_netlist_structs(0); } for(i = 0; i < lastselected; i++) { diff --git a/src/xschem.h b/src/xschem.h index ab926c7d..69704cf0 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -873,6 +873,7 @@ extern void arc_3_points(double x1, double y1, double x2, double y2, double x3, extern void move_objects(int what,int merge, double dx, double dy); extern void copy_objects(int what); extern void find_inst_to_be_redrawn(const char *node); +extern void find_inst_hash_clear(void); extern void pan(int what); extern void pan2(int what, int mx, int my); extern void zoom_box(int what);