optimization in delete() if show_pin_net_names is true, recheck connected elements only if deleting a pin or label.

This commit is contained in:
Stefan Schippers 2020-10-17 12:01:05 +02:00
parent 632dbd8931
commit f38a7d82ea
5 changed files with 12 additions and 7 deletions

View File

@ -1674,6 +1674,7 @@ void new_wire(int what, double mx_snap, double my_snap)
hash_wire(XINSERT, xctx->wires-1, 1);
/* prepared_hash_wires = 0; */
prepared_hilight_structs = 0;
update_conn_cues(1,1);
if(show_pin_net_names) {
prepare_netlist_structs(0);

View File

@ -463,7 +463,7 @@ static void signal_short( char *n1, char *n2)
}
}
static void wirecheck(int k) /* recursive routine */
void wirecheck(int k) /* recursive routine */
{
int tmpi,tmpj, counti,countj,i,j;
int touches;

View File

@ -927,6 +927,7 @@ int save_schematic(const char *schname) /* 20171020 added return value */
write_xschem_file(fd);
fclose(fd);
my_strncpy(xctx->current_name, rel_sym_path(name), S(xctx->current_name));
/* <<<<< >>>> why clear all these? */
prepared_hilight_structs=0;
prepared_netlist_structs=0;
prepared_hash_instances=0;

View File

@ -231,14 +231,16 @@ void delete(void)
}
for(i = 0; i < lastselected; i++) {
n = selectedgroup[i].n;
/* should be done only for ipin, opin, iopin, label <<<<< */
if(selectedgroup[i].type == ELEMENT) {
int p;
char *type = (xctx->inst[n].ptr + xctx->sym)->type;
symbol_bbox(n, &xctx->inst[n].x1, &xctx->inst[n].y1, &xctx->inst[n].x2, &xctx->inst[n].y2 );
bbox(ADD, xctx->inst[n].x1, xctx->inst[n].y1, xctx->inst[n].x2, xctx->inst[n].y2 );
if(show_pin_net_names) for(p = 0; p < (xctx->inst[n].ptr + xctx->sym)->rects[PINLAYER]; p++) {
if( xctx->inst[n].node && xctx->inst[n].node[p]) {
find_inst_to_be_redrawn(xctx->inst[n].node[p]);
if(show_pin_net_names && type && IS_LABEL_OR_PIN(type) ) {
for(p = 0; p < (xctx->inst[n].ptr + xctx->sym)->rects[PINLAYER]; p++) {
if( xctx->inst[n].node && xctx->inst[n].node[p]) {
find_inst_to_be_redrawn(xctx->inst[n].node[p]);
}
}
}
}

View File

@ -302,8 +302,8 @@ extern char win_temp_dir[PATH_MAX];
#define IS_PIN(type) (!(strcmp(type,"ipin") && strcmp(type,"opin") && strcmp(type,"iopin")))
#define X_TO_SCREEN(x) ( floor((x+xctx->xorigin)* xctx->mooz) )
#define Y_TO_SCREEN(y) ( floor((y+xctx->yorigin)* xctx->mooz) )
#define X_TO_SCREEN(x) ( floor(((x)+xctx->xorigin)* xctx->mooz) )
#define Y_TO_SCREEN(y) ( floor(((y)+xctx->yorigin)* xctx->mooz) )
#define X_TO_XSCHEM(x) ((x)*xctx->zoom -xctx->xorigin)
#define Y_TO_XSCHEM(y) ((y)*xctx->zoom -xctx->yorigin)
@ -798,6 +798,7 @@ extern void hash_inst_pin(int what, int i, int j);
extern void del_inst_table(void);
extern void hash_wires(void);
extern void hash_wire(int what, int n, int incremental);
extern void wirecheck(int k);
extern void hash_instances(void); /* 20171203 insert instance bbox in spatial hash table */
#ifdef HAS_CAIRO