regression fix: correctly hash new wires when inserted

This commit is contained in:
Stefan Schippers 2020-10-02 16:12:08 +02:00
parent 72f0031611
commit 6805335a09
3 changed files with 9 additions and 38 deletions

View File

@ -1673,40 +1673,12 @@ void new_wire(int what, double mx_snap, double my_snap)
printf("xschem wire %g %g %g %g %d\n", xx1, yy1, xx2, yy2, -1);
fflush(stdout);
}
prepared_hash_wires = 0;
prepared_hilight_structs = 0;
if(show_pin_net_names) {
int w;
/*
int i, p, rot, flip, save;
double x0, y0, rx1, ry1;
Box * rect;
*/
bbox(BEGIN , 0.0 , 0.0 , 0.0 , 0.0);
/*
save = lastwire;
lastwire=savelastwire;
for (i=0;i<lastinst;i++) {
for(p=0; p< (inst_ptr[i].ptr + instdef) -> rects[PINLAYER]; p++) {
rect=(inst_ptr[i].ptr+instdef)->boxptr[PINLAYER];
x0=(rect[p].x1+rect[p].x2)/2;
y0=(rect[p].y1+rect[p].y2)/2;
rot=inst_ptr[i].rot;
flip=inst_ptr[i].flip;
ROTATION(0.0,0.0,x0,y0,rx1,ry1);
x0=inst_ptr[i].x0+rx1;
y0=inst_ptr[i].y0+ry1;
for(w=savelastwire; w<save; w++) {
if(touch(wire[w].x1, wire[w].y1, wire[w].x2, wire[w].y2, x0, y0)) {
symbol_bbox(i, &inst_ptr[i].x1, &inst_ptr[i].y1, &inst_ptr[i].x2, &inst_ptr[i].y2 );
bbox(ADD, inst_ptr[i].x1, inst_ptr[i].y1, inst_ptr[i].x2, inst_ptr[i].y2 );
}
}
}
}
lastwire = save;
*/
prepared_hash_wires = 0;
prepared_hilight_structs = 0;
prepare_netlist_structs(0);
bbox(BEGIN , 0.0 , 0.0 , 0.0 , 0.0);
for(w=savelastwire; w<lastwire; w++) {
find_inst_to_be_redrawn(wire[w].node);
}

View File

@ -1381,14 +1381,12 @@ int callback(int event, int mx, int my, KeySym key,
draw();
break;
}
if(0 && key=='~' && (state & ControlMask)) /* testmode */
if(key=='~' && (state & ControlMask)) /* testmode */
{
int i;
dbg(0, "prepared_netlist_structs=%d prepared_hilight_structs=%d\n", prepared_netlist_structs, prepared_hilight_structs);
for(i = 0 ; i < lastinst; i++) {
dbg(0, "instance: %s, %s flags=%d\n", inst_ptr[i].name, inst_ptr[i].instname, inst_ptr[i].flags);
}
dbg(0, "test mode\n");
prepared_hilight_structs = 0;
prepared_hash_wires=0;
prepare_netlist_structs(0);
break;
}
if(0 && (key=='|') && !(state&ControlMask)) /* testmode */

View File

@ -631,6 +631,7 @@ void prepare_netlist_structs(int for_netlist)
if (for_netlist>0 && 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);