removed find_inst_to_be_redrawn() and related code (not worth doing)
This commit is contained in:
parent
d5fd026196
commit
a19020ed78
|
|
@ -73,6 +73,7 @@ p{padding: 15px 30px 10px;}
|
|||
tk8.6 tk8.6-dev
|
||||
flex bison
|
||||
libxpm4 libxpm-dev
|
||||
libjpeg-dev
|
||||
# terminal program and editor used by default by xschem:
|
||||
# alternative programs can be specified in xschemrc by
|
||||
# setting tcl variables 'terminal' and 'editor', respectively.
|
||||
|
|
|
|||
|
|
@ -2568,7 +2568,6 @@ static void restore_selection(double x1, double y1, double x2, double y2)
|
|||
|
||||
void new_wire(int what, double mx_snap, double my_snap)
|
||||
{
|
||||
int big = xctx->wires> 2000 || xctx->instances > 2000 ;
|
||||
int s_pnetname, modified = 0;
|
||||
if( (what & PLACE) ) {
|
||||
s_pnetname = tclgetboolvar("show_pin_net_names");
|
||||
|
|
@ -2626,21 +2625,10 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
if(s_pnetname || xctx->hilight_nets) {
|
||||
prepare_netlist_structs(0); /* since xctx->prep_hi_structs==0, do a delete_netlist_structs() first,
|
||||
* this clears both xctx->prep_hi_structs and xctx->prep_net_structs. */
|
||||
if(!big) {
|
||||
bbox(START , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
if(xctx->node_redraw_table.table == NULL) int_hash_init(&xctx->node_redraw_table, HASHSIZE);
|
||||
int_hash_lookup(&(xctx->node_redraw_table), xctx->wire[xctx->wires-1].node, 0, XINSERT_NOREPLACE);
|
||||
}
|
||||
if(!big) {
|
||||
find_inst_to_be_redrawn(1 + 4 + 8); /* add bboxes before and after symbol_bbox, don't use selection */
|
||||
find_inst_to_be_redrawn(16); /* delete hash and arrays */
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
}
|
||||
if(xctx->hilight_nets) {
|
||||
propagate_hilights(1, 1, XINSERT_NOREPLACE);
|
||||
}
|
||||
draw();
|
||||
if(!big) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
} else update_conn_cues(WIRELAYER, 1,1);
|
||||
/* draw_hilight_net(1);*/ /* for updating connection bubbles on hilight nets */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ void break_wires_at_pins(int remove)
|
|||
} /* for(j=0;j<xctx->lastsel; ++j) if(xctx->sel_array[j].type==ELEMENT) */
|
||||
|
||||
if(remove) {
|
||||
if(delete_wires(1, SELECTED4)) {
|
||||
if(delete_wires(SELECTED4)) {
|
||||
deleted_wire = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -860,8 +860,6 @@ static int edit_rect_property(int x)
|
|||
preserve = tclgetboolvar("preserve_unchanged_attrs");
|
||||
if(strcmp(tclgetvar("rcode"),"") )
|
||||
{
|
||||
int floaters = there_are_floaters();
|
||||
dbg(1, "floaters=%d\n", floaters);
|
||||
xctx->push_undo();
|
||||
for(i=0; i<xctx->lastsel; ++i) {
|
||||
if(xctx->sel_array[i].type != xRECT) continue;
|
||||
|
|
@ -890,21 +888,15 @@ static int edit_rect_property(int x)
|
|||
if( (oldprop && xctx->rect[c][n].prop_ptr && strcmp(oldprop, xctx->rect[c][n].prop_ptr)) ||
|
||||
(!oldprop && xctx->rect[c][n].prop_ptr) || (oldprop && !xctx->rect[c][n].prop_ptr)) {
|
||||
if(!drw) {
|
||||
if(!floaters) bbox(START,0.0,0.0,0.0,0.0);
|
||||
drw = 1;
|
||||
}
|
||||
if( xctx->rect[c][n].flags & 1024) {
|
||||
draw_image(0, &xctx->rect[c][n], &xctx->rect[c][n].x1, &xctx->rect[c][n].y1,
|
||||
&xctx->rect[c][n].x2, &xctx->rect[c][n].y2, 0, 0);
|
||||
}
|
||||
if(!floaters) {
|
||||
bbox(ADD, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!floaters && drw) bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
if(drw) draw();
|
||||
if(!floaters && drw) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
modified = 1;
|
||||
}
|
||||
my_free(_ALLOC_ID_, &oldprop);
|
||||
|
|
@ -1184,7 +1176,6 @@ static int edit_text_property(int x)
|
|||
char property[100];/* used for float 2 string conv (xscale and yscale) overflow safe */
|
||||
/* const char *str; */
|
||||
char *oldprop = NULL;
|
||||
int floater = there_are_floaters();
|
||||
|
||||
if(x < 0 || x > 2) {
|
||||
fprintf(errfp, "edit_text_property() : unknown parameter x=%d\n",x);
|
||||
|
|
@ -1231,8 +1222,7 @@ static int edit_text_property(int x)
|
|||
modified = 1;
|
||||
xctx->push_undo();
|
||||
}
|
||||
if(!floater) bbox(START,0.0,0.0,0.0,0.0);
|
||||
else set_modify(-2); /* clear text floater caches */
|
||||
set_modify(-2); /* clear text floater caches */
|
||||
for(k=0;k<xctx->lastsel; ++k)
|
||||
{
|
||||
if(xctx->sel_array[k].type!=xTEXT) continue;
|
||||
|
|
@ -1251,7 +1241,6 @@ static int edit_text_property(int x)
|
|||
cairo_restore(xctx->cairo_ctx);
|
||||
}
|
||||
#endif
|
||||
if(!floater) bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
/* dbg(1, "edit_property(): text props=%s text=%s\n", tclgetvar("props"), tclgetvar("retval")); */
|
||||
if(text_changed) {
|
||||
double cg;
|
||||
|
|
@ -1325,11 +1314,8 @@ static int edit_text_property(int x)
|
|||
}
|
||||
#endif
|
||||
|
||||
if(!floater) bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
} /* for(k=0;k<xctx->lastsel; ++k) */
|
||||
if(!floater) bbox(SET,0.0,0.0,0.0,0.0);
|
||||
draw();
|
||||
if(!floater) bbox(END,0.0,0.0,0.0,0.0);
|
||||
}
|
||||
my_free(_ALLOC_ID_, &oldprop);
|
||||
return modified;
|
||||
|
|
@ -1350,7 +1336,7 @@ static int update_symbol(const char *result, int x, int selected_inst)
|
|||
int pushed=0;
|
||||
int *ii = &xctx->edit_sym_i; /* static var */
|
||||
int *netl_com = &xctx->netlist_commands; /* static var */
|
||||
int generator = 0,floaters, modified = 0;
|
||||
int modified = 0;
|
||||
|
||||
dbg(1, "update_symbol(): entering, selected_inst = %d\n", selected_inst);
|
||||
*ii = selected_inst;
|
||||
|
|
@ -1372,15 +1358,10 @@ static int update_symbol(const char *result, int x, int selected_inst)
|
|||
dbg(1, "update_symbol(): new_prop=%s\n", new_prop);
|
||||
}
|
||||
my_strncpy(symbol, (char *) tclgetvar("symbol") , S(symbol));
|
||||
generator = is_generator(symbol);
|
||||
dbg(1, "update_symbol(): symbol=%s\n", symbol);
|
||||
no_change_props=tclgetboolvar("no_change_attrs");
|
||||
only_different=tclgetboolvar("preserve_unchanged_attrs");
|
||||
copy_cell=tclgetboolvar("user_wants_copy_cell");
|
||||
/* if there are floaters or generators (dynamic symbols, pCells) do not collect
|
||||
* list of things to redraw, just redraw all screen */
|
||||
floaters = there_are_floaters() || generator;
|
||||
if(!floaters) bbox(START,0.0,0.0,0.0,0.0);
|
||||
/* 20191227 necessary? --> Yes since a symbol copy has already been done
|
||||
in edit_symbol_property() -> tcl edit_prop, this ensures new symbol is loaded from disk.
|
||||
if for some reason a symbol with matching name is loaded in xschem this
|
||||
|
|
@ -1401,8 +1382,6 @@ static int update_symbol(const char *result, int x, int selected_inst)
|
|||
/* 20171220 calculate bbox before changes to correctly redraw areas */
|
||||
/* must be recalculated as cairo text extents vary with zoom factor. */
|
||||
symbol_bbox(*ii, &xctx->inst[*ii].x1, &xctx->inst[*ii].y1, &xctx->inst[*ii].x2, &xctx->inst[*ii].y2);
|
||||
if(!floaters)
|
||||
bbox(ADD, xctx->inst[*ii].x1, xctx->inst[*ii].y1, xctx->inst[*ii].x2, xctx->inst[*ii].y2);
|
||||
my_strdup2(_ALLOC_ID_, &old_translated_sym, translate(*ii, xctx->inst[*ii].name));
|
||||
|
||||
/* update property string from tcl dialog */
|
||||
|
|
@ -1499,23 +1478,14 @@ static int update_symbol(const char *result, int x, int selected_inst)
|
|||
xctx->prep_hash_inst=0;
|
||||
xctx->prep_net_structs=0;
|
||||
xctx->prep_hi_structs=0;
|
||||
if(floaters) { /* we need to recalculate bbox of dynamic symbols (floaters/ generators) after prop changes */
|
||||
symbol_bbox(*ii, &xctx->inst[*ii].x1, &xctx->inst[*ii].y1, &xctx->inst[*ii].x2, &xctx->inst[*ii].y2);
|
||||
}
|
||||
if(!floaters) {
|
||||
find_inst_to_be_redrawn(1 + 4 + 32); /* 32: call prepare_netlist_structs(0) */
|
||||
find_inst_to_be_redrawn(16); /* clear data */
|
||||
}
|
||||
symbol_bbox(*ii, &xctx->inst[*ii].x1, &xctx->inst[*ii].y1, &xctx->inst[*ii].x2, &xctx->inst[*ii].y2);
|
||||
if(xctx->hilight_nets) {
|
||||
propagate_hilights(1, 1, XINSERT_NOREPLACE);
|
||||
}
|
||||
}
|
||||
/* redraw symbol with new props */
|
||||
if(!floaters) bbox(SET,0.0,0.0,0.0,0.0);
|
||||
else set_modify(-2); /* reset floaters caches */
|
||||
dbg(1, "update_symbol(): redrawing : floaters=%d\n", floaters);
|
||||
set_modify(-2); /* reset floaters caches */
|
||||
draw();
|
||||
if(!floaters) bbox(END,0.0,0.0,0.0,0.0);
|
||||
my_free(_ALLOC_ID_, &name);
|
||||
my_free(_ALLOC_ID_, &ptr);
|
||||
my_free(_ALLOC_ID_, &new_prop);
|
||||
|
|
|
|||
320
src/move.c
320
src/move.c
|
|
@ -512,171 +512,9 @@ void draw_selection(GC g, int interruptable)
|
|||
xctx->movelastsel = i;
|
||||
}
|
||||
|
||||
/*
|
||||
* build list of nodes attached to objects (wires, pins, wire labels) about to be moved/copied/deleted,
|
||||
* first time call with find_inst_to_be_redrawn(1), before doing the move/copy/delete,
|
||||
* then call with find_inst_to_be_redrawn(6) (2 | 4) after move/copy/delete is done.
|
||||
* what (bits can be ORed together):
|
||||
* 1: collect list of instances to be redrawn, add bboxes
|
||||
* 2: use previously collected list, add bboxes with updated node names, do this call after moving/deleting
|
||||
* objects and after a prepare_netlist_structs()
|
||||
* 4: call symbol_bbox before bbox(ADD, ...)
|
||||
* 8: do NOT build xctx->node_redraw_table using selected instances/wires
|
||||
* 16: clear hash and arrays
|
||||
* 32: call prepare_netlist_structs(0) if hilights or show net name on pins
|
||||
*/
|
||||
void find_inst_to_be_redrawn(int what)
|
||||
{
|
||||
Int_hashentry *nentry;
|
||||
int i, n, p, rects;
|
||||
xSymbol * sym;
|
||||
xInstance * const inst = xctx->inst;
|
||||
|
||||
int s_pnetname = tclgetboolvar("show_pin_net_names");
|
||||
int lvs_ignore = tclgetboolvar("lvs_ignore");
|
||||
|
||||
|
||||
dbg(1,"find_inst_to_be_redrawn(): what=%d\n", what);
|
||||
if(what & 16) {
|
||||
my_free(_ALLOC_ID_, &xctx->inst_redraw_table);
|
||||
xctx->inst_redraw_table_size = 0;
|
||||
if((s_pnetname || xctx->hilight_nets)) int_hash_free(&xctx->node_redraw_table);
|
||||
return;
|
||||
}
|
||||
if((s_pnetname || xctx->hilight_nets)) {
|
||||
if(xctx->node_redraw_table.table == NULL) int_hash_init(&xctx->node_redraw_table, HASHSIZE);
|
||||
if(what & 32) prepare_netlist_structs(0);
|
||||
if(!(what & 8)) {
|
||||
for(i=0;i<xctx->lastsel; ++i)
|
||||
{
|
||||
n = xctx->sel_array[i].n;
|
||||
if( xctx->sel_array[i].type == ELEMENT) {
|
||||
int p;
|
||||
char *type;
|
||||
int shorted_inst;
|
||||
if(xctx->inst[n].ptr < 0 ) continue;
|
||||
type=xctx->sym[xctx->inst[n].ptr].type;
|
||||
set_inst_flags(&xctx->inst[n]);
|
||||
shorted_inst = shorted_instance(n, lvs_ignore);
|
||||
/* collect all nodes connected to instances that set node names */
|
||||
if(type &&
|
||||
(
|
||||
IS_LABEL_OR_PIN(type) ||
|
||||
/* some pass through symbols have type show_label (metal option)
|
||||
* | */
|
||||
(!strcmp(type, "show_label") && (inst[n].ptr + xctx->sym)->rects[PINLAYER] > 1) ||
|
||||
/* bus taps */
|
||||
!strcmp(type, "bus_tap") ||
|
||||
/* instances that have lvs_ignore=true and global lvs_ignore is set */
|
||||
shorted_inst
|
||||
)
|
||||
) {
|
||||
for(p = 0; p < (inst[n].ptr + xctx->sym)->rects[PINLAYER]; p++) {
|
||||
if( inst[n].node && inst[n].node[p]) {
|
||||
dbg(1,"find_inst_to_be_redrawn(): hashing inst %s, node %s\n", inst[n].instname, inst[n].node[p]);
|
||||
int_hash_lookup(&xctx->node_redraw_table, xctx->inst[n].node[p], 0, XINSERT_NOREPLACE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* collect all nodes connected to selected wires (node names will change if wire deleted/moved) */
|
||||
if(xctx->sel_array[i].type == WIRE) {
|
||||
int_hash_lookup(&xctx->node_redraw_table, xctx->wire[n].node, 0, XINSERT_NOREPLACE);
|
||||
}
|
||||
}
|
||||
/* propagate all node[0] of bus taps that have node[1] hashed above */
|
||||
for(i=0; i < xctx->instances; ++i) {
|
||||
char *type=xctx->sym[xctx->inst[i].ptr].type;
|
||||
/* bus taps */
|
||||
if(type && !strcmp(type, "bus_tap")) {
|
||||
if(int_hash_lookup(&xctx->node_redraw_table, xctx->inst[i].node[1], 0, XLOOKUP)) {
|
||||
int_hash_lookup(&xctx->node_redraw_table, xctx->inst[i].node[0], 0, XINSERT_NOREPLACE);
|
||||
dbg(1, "bus_tap: propagate %s\n", xctx->inst[i].node[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* if(!(what & 8)) */
|
||||
|
||||
if(!xctx->inst_redraw_table) {
|
||||
xctx->inst_redraw_table = my_calloc(_ALLOC_ID_, xctx->instances, sizeof(unsigned char));
|
||||
} else if(xctx->instances > xctx->inst_redraw_table_size) {
|
||||
my_realloc(_ALLOC_ID_, &xctx->inst_redraw_table, xctx->instances * sizeof(unsigned char));
|
||||
memset(xctx->inst_redraw_table + xctx->inst_redraw_table_size, 0,
|
||||
(xctx->instances - xctx->inst_redraw_table_size) * sizeof(unsigned char));
|
||||
xctx->inst_redraw_table_size = xctx->instances;
|
||||
}
|
||||
for(i=0; i < xctx->instances; ++i) {
|
||||
sym = xctx->inst[i].ptr + xctx->sym;
|
||||
rects = sym->rects[PINLAYER];
|
||||
if(what & 2 && xctx->inst_redraw_table[i]) {
|
||||
dbg(1, "find_inst_to_be_redrawn(): 1 bboxing inst %s\n", xctx->inst[i].instname);
|
||||
if(what & 1) bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2 );
|
||||
if(what & 4) {
|
||||
symbol_bbox(i, &inst[i].x1, &inst[i].y1, &inst[i].x2, &inst[i].y2 );
|
||||
bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2 );
|
||||
}
|
||||
continue;
|
||||
}
|
||||
for(p = 0; p < rects; p++) {
|
||||
if(xctx->inst[i].node && xctx->inst[i].node[p]) {
|
||||
nentry = int_hash_lookup(&xctx->node_redraw_table, xctx->inst[i].node[p], 0, XLOOKUP);
|
||||
if(nentry) {
|
||||
dbg(1, "find_inst_to_be_redrawn(): 2 bboxing inst %s\n", xctx->inst[i].instname);
|
||||
if(what & 1) bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2);
|
||||
if(what & 4) {
|
||||
symbol_bbox(i, &inst[i].x1, &inst[i].y1, &inst[i].x2, &inst[i].y2);
|
||||
bbox(ADD, xctx->inst[i].x1, xctx->inst[i].y1, xctx->inst[i].x2, xctx->inst[i].y2);
|
||||
}
|
||||
xctx->inst_redraw_table[i] = 1; /* keep list of instances to be redrawn for faster lookup when
|
||||
* what==2 in following calls */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(what & 5) for(i=0;i < xctx->wires; ++i) {
|
||||
if(xctx->wire[i].node) {
|
||||
nentry = int_hash_lookup(&xctx->node_redraw_table, xctx->wire[i].node, 0, XLOOKUP);
|
||||
if(nentry) {
|
||||
if(xctx->wire[i].bus){
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; }
|
||||
else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; }
|
||||
dbg(1, "find_inst_to_be_redrawn(): 3 bboxing wire %d\n", i);
|
||||
bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; }
|
||||
else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; }
|
||||
dbg(1, "find_inst_to_be_redrawn(): 4 bboxing wire %d\n", i);
|
||||
bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* if((s_pnetname || xctx->hilight_nets)) */
|
||||
if(!(what & 8) ) {
|
||||
if(what & 5) for(i=0;i<xctx->lastsel; ++i) { /* add bboxes of selected objects */
|
||||
n = xctx->sel_array[i].n;
|
||||
if( xctx->sel_array[i].type == ELEMENT) {
|
||||
dbg(1, "find_inst_to_be_redrawn(): 5 bboxing inst %s\n", xctx->inst[n].instname);
|
||||
if(what & 1) bbox(ADD, inst[n].x1, inst[n].y1, inst[n].x2, inst[n].y2 );
|
||||
if(what & 4) {
|
||||
symbol_bbox(n, &inst[n].x1, &inst[n].y1, &inst[n].x2, &inst[n].y2);
|
||||
bbox(ADD, inst[n].x1, inst[n].y1, inst[n].x2, inst[n].y2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void copy_objects(int what)
|
||||
{
|
||||
int tmpi, c, i, n, k /*, tmp */ ;
|
||||
xRect tmp;
|
||||
double angle, dtmp;
|
||||
int newpropcnt;
|
||||
double tmpx, tmpy;
|
||||
|
|
@ -742,12 +580,10 @@ void copy_objects(int what)
|
|||
if(what & END) /* copy selected objects */
|
||||
{
|
||||
int l, firstw, firsti;
|
||||
int floaters = there_are_floaters();
|
||||
|
||||
set_first_sel(0, -1, 0); /* reset first selected object */
|
||||
if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0;
|
||||
|
||||
if(!floaters) bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
newpropcnt=0;
|
||||
|
||||
if( !xctx->kissing ) {
|
||||
|
|
@ -758,8 +594,6 @@ void copy_objects(int what)
|
|||
firstw = firsti = 1;
|
||||
draw_selection(xctx->gctiled,0);
|
||||
update_symbol_bboxes(0, 0);
|
||||
/* build list before copying and recalculating prepare_netlist_structs() */
|
||||
if(!floaters) find_inst_to_be_redrawn(0);
|
||||
|
||||
for(i=0;i<xctx->lastsel; ++i)
|
||||
{
|
||||
|
|
@ -803,19 +637,6 @@ void copy_objects(int what)
|
|||
xctx->wire[n].sel=0;
|
||||
|
||||
l = xctx->wires -1;
|
||||
if(xctx->wire[n].bus){
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(xctx->wire[l].y1 < xctx->wire[l].y2) { y1 = xctx->wire[l].y1-ov; y2 = xctx->wire[l].y2+ov; }
|
||||
else { y1 = xctx->wire[l].y1+ov; y2 = xctx->wire[l].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->wire[l].x1-ov, y1 , xctx->wire[l].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(xctx->wire[l].y1 < xctx->wire[l].y2) { y1 = xctx->wire[l].y1-ov; y2 = xctx->wire[l].y2+ov; }
|
||||
else { y1 = xctx->wire[l].y1+ov; y2 = xctx->wire[l].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->wire[l].x1-ov, y1 , xctx->wire[l].x2+ov , y2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -863,21 +684,6 @@ void copy_objects(int what)
|
|||
xctx->line[c][n].sel=0;
|
||||
|
||||
l = xctx->lines[c] - 1;
|
||||
if(xctx->line[c][l].bus){
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(xctx->line[c][l].y1 < xctx->line[c][l].y2)
|
||||
{ y1 = xctx->line[c][l].y1-ov; y2 = xctx->line[c][l].y2+ov; }
|
||||
else { y1 = xctx->line[c][l].y1+ov; y2 = xctx->line[c][l].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][l].x1-ov, y1 , xctx->line[c][l].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(xctx->line[c][l].y1 < xctx->line[c][l].y2)
|
||||
{ y1 = xctx->line[c][l].y1-ov; y2 = xctx->line[c][l].y2+ov; }
|
||||
else { y1 = xctx->line[c][l].y1+ov; y2 = xctx->line[c][l].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][l].x1-ov, y1 , xctx->line[c][l].x2+ov , y2 );
|
||||
}
|
||||
break;
|
||||
|
||||
case POLYGON:
|
||||
|
|
@ -906,7 +712,6 @@ void copy_objects(int what)
|
|||
if(j==0 || x[j] > bx2) bx2 = x[j];
|
||||
if(j==0 || y[j] > by2) by2 = y[j];
|
||||
}
|
||||
if(!floaters) bbox(ADD, bx1, by1, bx2, by2);
|
||||
xctx->sel_array[i].n=xctx->polygons[c];
|
||||
store_poly(-1, x, y, p->points, c, p->sel, p->prop_ptr);
|
||||
p->sel=0;
|
||||
|
|
@ -939,16 +744,6 @@ void copy_objects(int what)
|
|||
xctx->arc[c][n].r, angle, xctx->arc[c][n].b, c, SELECTED, xctx->arc[c][n].prop_ptr);
|
||||
|
||||
l = xctx->arcs[c] - 1;
|
||||
if(!floaters) {
|
||||
if(xctx->arc[c][l].fill) {
|
||||
arc_bbox(xctx->arc[c][l].x, xctx->arc[c][l].y, xctx->arc[c][l].r,
|
||||
0, 360, &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
} else {
|
||||
arc_bbox(xctx->arc[c][l].x, xctx->arc[c][l].y, xctx->arc[c][l].r,
|
||||
xctx->arc[c][l].a, xctx->arc[c][n].b, &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
}
|
||||
bbox(ADD, tmp.x1, tmp.y1, tmp.x2, tmp.y2);
|
||||
}
|
||||
break;
|
||||
|
||||
case xRECT:
|
||||
|
|
@ -971,7 +766,6 @@ void copy_objects(int what)
|
|||
storeobject(-1, xctx->rx1+xctx->deltax, xctx->ry1+xctx->deltay,
|
||||
xctx->rx2+xctx->deltax, xctx->ry2+xctx->deltay,xRECT, c, SELECTED, xctx->rect[c][n].prop_ptr);
|
||||
l = xctx->rects[c] - 1;
|
||||
if(!floaters) bbox(ADD, xctx->rect[c][l].x1, xctx->rect[c][l].y1, xctx->rect[c][l].x2, xctx->rect[c][l].y2);
|
||||
break;
|
||||
|
||||
case xTEXT:
|
||||
|
|
@ -1022,7 +816,6 @@ void copy_objects(int what)
|
|||
cairo_restore(xctx->cairo_ctx);
|
||||
}
|
||||
#endif
|
||||
if(!floaters) bbox(ADD, xctx->rx1, xctx->ry1, xctx->rx2, xctx->ry2 );
|
||||
|
||||
xctx->sel_array[i].n=xctx->texts;
|
||||
xctx->texts++;
|
||||
|
|
@ -1076,8 +869,7 @@ void copy_objects(int what)
|
|||
new_prop_string(xctx->instances, xctx->inst[n].prop_ptr,newpropcnt++, /* sets also inst[].instname */
|
||||
tclgetboolvar("disable_unique_names"));
|
||||
hash_names(xctx->instances, XINSERT);
|
||||
/* this is needed since no find_inst_to_be_redrawn() is executed if floaters are present */
|
||||
if(floaters) symbol_bbox(xctx->instances,
|
||||
symbol_bbox(xctx->instances,
|
||||
&xctx->inst[xctx->instances].x1, &xctx->inst[xctx->instances].y1,
|
||||
&xctx->inst[xctx->instances].x2, &xctx->inst[xctx->instances].y2);
|
||||
xctx->instances++;
|
||||
|
|
@ -1090,10 +882,6 @@ void copy_objects(int what)
|
|||
xctx->prep_hi_structs=0;
|
||||
}
|
||||
/* build after copying and after recalculating prepare_netlist_structs() */
|
||||
if(!floaters) {
|
||||
find_inst_to_be_redrawn(1 + 2 + 4 + 32); /* 32: call prepare_netlist_structs(0) */
|
||||
find_inst_to_be_redrawn(16); /* clear data */
|
||||
}
|
||||
check_collapsing_objects();
|
||||
if(tclgetboolvar("autotrim_wires")) trim_wires();
|
||||
if(xctx->hilight_nets) {
|
||||
|
|
@ -1103,9 +891,7 @@ void copy_objects(int what)
|
|||
xctx->x1 = xctx->y_1 = xctx->x2 = xctx->y_2 = xctx->deltax = xctx->deltay = 0;
|
||||
xctx->move_rot = xctx->move_flip = 0;
|
||||
set_modify(1); /* must be done before draw() if floaters are present to force cached values update */
|
||||
if(!floaters) bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
if(!floaters) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
xctx->rotatelocal=0;
|
||||
} /* if(what & END) */
|
||||
draw_selection(xctx->gc[SELLAYER], 0);
|
||||
|
|
@ -1117,7 +903,6 @@ void copy_objects(int what)
|
|||
void move_objects(int what, int merge, double dx, double dy)
|
||||
{
|
||||
int c, i, n, k, tmpint;
|
||||
xRect tmp;
|
||||
double angle, dtmp;
|
||||
double tx1,ty1; /* temporaries for swapping coordinates 20070302 */
|
||||
#if HAS_CAIRO==1
|
||||
|
|
@ -1179,10 +964,8 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
if(what & END) /* move selected objects */
|
||||
{
|
||||
int firsti, firstw;
|
||||
int floaters = there_are_floaters();
|
||||
|
||||
if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0;
|
||||
if(!floaters) bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
/* no undo push for MERGE ad PLACE, already done before */
|
||||
if( !xctx->kissing && !(xctx->ui_state & (STARTMERGE | PLACE_SYMBOL | PLACE_TEXT)) ) {
|
||||
dbg(1, "move_objects(): push undo state\n");
|
||||
|
|
@ -1204,7 +987,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
firsti = firstw = 1;
|
||||
draw_selection(xctx->gctiled,0);
|
||||
update_symbol_bboxes(0, 0);
|
||||
if(!floaters) find_inst_to_be_redrawn(0); /* build list before moving and recalculating prepare_netlist_structs() */
|
||||
for(k=0;k<cadlayers; ++k)
|
||||
{
|
||||
for(i=0;i<xctx->lastsel; ++i)
|
||||
|
|
@ -1216,21 +998,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->prep_hash_wires=0;
|
||||
firstw = 0;
|
||||
if(k == 0) {
|
||||
|
||||
if(wire[n].bus){ /* bbox before move */
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
}
|
||||
|
||||
if(xctx->rotatelocal) {
|
||||
ROTATION(xctx->move_rot, xctx->move_flip, wire[n].x1, wire[n].y1,
|
||||
wire[n].x1, wire[n].y1, xctx->rx1,xctx->ry1);
|
||||
|
|
@ -1264,41 +1031,11 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
wire[n].y1=xctx->ry1;
|
||||
wire[n].x2=xctx->rx2;
|
||||
wire[n].y2=xctx->ry2;
|
||||
|
||||
if(wire[n].bus){ /* bbox after move */
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(wire[n].y1 < wire[n].y2) { y1 = wire[n].y1-ov; y2 = wire[n].y2+ov; }
|
||||
else { y1 = wire[n].y1+ov; y2 = wire[n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, wire[n].x1-ov, y1 , wire[n].x2+ov , y2 );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LINE:
|
||||
if(c!=k) break;
|
||||
if(xctx->line[c][n].bus){ /* bbox before move */
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(xctx->line[c][n].y1 < xctx->line[c][n].y2)
|
||||
{ y1 = xctx->line[c][n].y1-ov; y2 = xctx->line[c][n].y2+ov; }
|
||||
else { y1 = xctx->line[c][n].y1+ov; y2 = xctx->line[c][n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][n].x1-ov, y1 , xctx->line[c][n].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(xctx->line[c][n].y1 < xctx->line[c][n].y2)
|
||||
{ y1 = xctx->line[c][n].y1-ov; y2 = xctx->line[c][n].y2+ov; }
|
||||
else { y1 = xctx->line[c][n].y1+ov; y2 = xctx->line[c][n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][n].x1-ov, y1 , xctx->line[c][n].x2+ov , y2 );
|
||||
}
|
||||
|
||||
if(xctx->rotatelocal) {
|
||||
ROTATION(xctx->move_rot, xctx->move_flip, line[c][n].x1, line[c][n].y1,
|
||||
line[c][n].x1, line[c][n].y1, xctx->rx1,xctx->ry1);
|
||||
|
|
@ -1333,22 +1070,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
line[c][n].y1=xctx->ry1;
|
||||
line[c][n].x2=xctx->rx2;
|
||||
line[c][n].y2=xctx->ry2;
|
||||
|
||||
if(xctx->line[c][n].bus){ /* bbox after move */
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(xctx->line[c][n].y1 < xctx->line[c][n].y2)
|
||||
{ y1 = xctx->line[c][n].y1-ov; y2 = xctx->line[c][n].y2+ov; }
|
||||
else { y1 = xctx->line[c][n].y1+ov; y2 = xctx->line[c][n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][n].x1-ov, y1 , xctx->line[c][n].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(xctx->line[c][n].y1 < xctx->line[c][n].y2)
|
||||
{ y1 = xctx->line[c][n].y1-ov; y2 = xctx->line[c][n].y2+ov; }
|
||||
else { y1 = xctx->line[c][n].y1+ov; y2 = xctx->line[c][n].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][n].x1-ov, y1 , xctx->line[c][n].x2+ov , y2 );
|
||||
}
|
||||
break;
|
||||
|
||||
case POLYGON:
|
||||
|
|
@ -1380,7 +1101,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
}
|
||||
|
||||
}
|
||||
if(!floaters) bbox(ADD, bx1, by1, bx2, by2); /* bbox before move */
|
||||
|
||||
for(j=0; j<p->points; ++j) {
|
||||
if(j==0 || p->x[j] < bx1) bx1 = p->x[j];
|
||||
|
|
@ -1388,24 +1108,11 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
if(j==0 || p->x[j] > bx2) bx2 = p->x[j];
|
||||
if(j==0 || p->y[j] > by2) by2 = p->y[j];
|
||||
}
|
||||
if(!floaters) bbox(ADD, bx1, by1, bx2, by2); /* bbox after move */
|
||||
}
|
||||
break;
|
||||
|
||||
case ARC:
|
||||
if(c!=k) break;
|
||||
|
||||
if(!floaters) {
|
||||
if(xctx->arc[c][n].fill) {/* bbox before move */
|
||||
arc_bbox(xctx->arc[c][n].x, xctx->arc[c][n].y, xctx->arc[c][n].r,
|
||||
0, 360, &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
} else {
|
||||
arc_bbox(xctx->arc[c][n].x, xctx->arc[c][n].y, xctx->arc[c][n].r,
|
||||
xctx->arc[c][n].a, xctx->arc[c][n].b, &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
}
|
||||
bbox(ADD, tmp.x1, tmp.y1, tmp.x2, tmp.y2);
|
||||
}
|
||||
|
||||
if(xctx->rotatelocal) {
|
||||
/* rotate center wrt itself: do nothing */
|
||||
xctx->rx1 = xctx->arc[c][n].x;
|
||||
|
|
@ -1446,24 +1153,11 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->arc[c][n].y = xctx->ry1;
|
||||
xctx->arc[c][n].b = angle;
|
||||
}
|
||||
|
||||
if(!floaters) {
|
||||
if(xctx->arc[c][n].fill) {/* bbox after move */
|
||||
arc_bbox(xctx->arc[c][n].x, xctx->arc[c][n].y, xctx->arc[c][n].r,
|
||||
0, 360, &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
} else {
|
||||
arc_bbox(xctx->arc[c][n].x, xctx->arc[c][n].y, xctx->arc[c][n].r,
|
||||
xctx->arc[c][n].a, xctx->arc[c][n].b, &tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
}
|
||||
bbox(ADD, tmp.x1, tmp.y1, tmp.x2, tmp.y2);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case xRECT:
|
||||
if(c!=k) break;
|
||||
/* bbox before move */
|
||||
if(!floaters) bbox(ADD, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2);
|
||||
if(xctx->rotatelocal) {
|
||||
ROTATION(xctx->move_rot, xctx->move_flip, xctx->rect[c][n].x1, xctx->rect[c][n].y1,
|
||||
xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rx1,xctx->ry1);
|
||||
|
|
@ -1538,7 +1232,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->rect[c][n].y2 = xctx->ry2;
|
||||
|
||||
/* bbox after move */
|
||||
if(!floaters) bbox(ADD, xctx->rect[c][n].x1, xctx->rect[c][n].y1, xctx->rect[c][n].x2, xctx->rect[c][n].y2);
|
||||
break;
|
||||
|
||||
case xTEXT:
|
||||
|
|
@ -1555,7 +1248,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
cairo_restore(xctx->cairo_ctx);
|
||||
}
|
||||
#endif
|
||||
if(!floaters) bbox(ADD, xctx->rx1, xctx->ry1, xctx->rx2, xctx->ry2 );
|
||||
if(xctx->rotatelocal) {
|
||||
ROTATION(xctx->move_rot, xctx->move_flip, xctx->text[n].x0, xctx->text[n].y0,
|
||||
xctx->text[n].x0, xctx->text[n].y0, xctx->rx1,xctx->ry1);
|
||||
|
|
@ -1581,7 +1273,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
cairo_restore(xctx->cairo_ctx);
|
||||
}
|
||||
#endif
|
||||
if(!floaters) bbox(ADD, xctx->rx1, xctx->ry1, xctx->rx2, xctx->ry2 );
|
||||
|
||||
break;
|
||||
|
||||
|
|
@ -1608,8 +1299,7 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->inst[n].rot = (xctx->inst[n].rot +
|
||||
( (xctx->move_flip && (xctx->inst[n].rot & 1) ) ? xctx->move_rot+2 : xctx->move_rot) ) & 0x3;
|
||||
xctx->inst[n].flip = xctx->move_flip ^ xctx->inst[n].flip;
|
||||
/* this is needed since no find_inst_to_be_redrawn() is executed if floaters are present */
|
||||
if(floaters) symbol_bbox(n,
|
||||
symbol_bbox(n,
|
||||
&xctx->inst[n].x1, &xctx->inst[n].y1,
|
||||
&xctx->inst[n].x2, &xctx->inst[n].y2);
|
||||
}
|
||||
|
|
@ -1619,10 +1309,6 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->prep_hi_structs=0;
|
||||
}
|
||||
/* build after copying and after recalculating prepare_netlist_structs() */
|
||||
if(!floaters) {
|
||||
find_inst_to_be_redrawn(1 + 2 + 4 + 32); /* 32: call prepare_netlist_structs(0) */
|
||||
find_inst_to_be_redrawn(16); /* clear data */
|
||||
}
|
||||
check_collapsing_objects();
|
||||
unselect_partial_sel_wires();
|
||||
if(tclgetboolvar("autotrim_wires")) trim_wires();
|
||||
|
|
@ -1637,9 +1323,7 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
xctx->move_rot=xctx->move_flip=0;
|
||||
xctx->x1=xctx->y_1=xctx->x2=xctx->y_2=xctx->deltax=xctx->deltay=0.;
|
||||
set_modify(1); /* must be done before draw() if floaters are present to force cached values update */
|
||||
if(!floaters) bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
if(!floaters) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
xctx->rotatelocal=0;
|
||||
|
||||
|
||||
|
|
|
|||
69
src/select.c
69
src/select.c
|
|
@ -383,7 +383,7 @@ void symbol_bbox(int i, double *x1,double *y1, double *x2, double *y2)
|
|||
}
|
||||
|
||||
|
||||
static void del_rect_line_arc_poly(int floaters)
|
||||
static void del_rect_line_arc_poly()
|
||||
{
|
||||
xRect tmp;
|
||||
int c, j, i;
|
||||
|
|
@ -398,7 +398,6 @@ static void del_rect_line_arc_poly(int floaters)
|
|||
{
|
||||
if(c == GRIDLAYER) xctx->graph_lastsel = -1; /* invalidate last selected graph */
|
||||
++j;
|
||||
if(!floaters) bbox(ADD, xctx->rect[c][i].x1, xctx->rect[c][i].y1, xctx->rect[c][i].x2, xctx->rect[c][i].y2);
|
||||
my_free(_ALLOC_ID_, &xctx->rect[c][i].prop_ptr);
|
||||
set_rect_extraptr(0, &xctx->rect[c][i]);
|
||||
deleted = 1;
|
||||
|
|
@ -416,15 +415,6 @@ static void del_rect_line_arc_poly(int floaters)
|
|||
if(xctx->line[c][i].sel == SELECTED)
|
||||
{
|
||||
++j;
|
||||
if(xctx->line[c][i].bus){
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw);
|
||||
if(xctx->line[c][i].y1 < xctx->line[c][i].y2) { y1 = xctx->line[c][i].y1-ov; y2 = xctx->line[c][i].y2+ov; }
|
||||
else { y1 = xctx->line[c][i].y1+ov; y2 = xctx->line[c][i].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->line[c][i].x1-ov, y1 , xctx->line[c][i].x2+ov , y2 );
|
||||
} else {
|
||||
if(!floaters) bbox(ADD, xctx->line[c][i].x1, xctx->line[c][i].y1 , xctx->line[c][i].x2 , xctx->line[c][i].y2 );
|
||||
}
|
||||
deleted = 1;
|
||||
my_free(_ALLOC_ID_, &xctx->line[c][i].prop_ptr);
|
||||
continue;
|
||||
|
|
@ -449,7 +439,6 @@ static void del_rect_line_arc_poly(int floaters)
|
|||
else
|
||||
arc_bbox(xctx->arc[c][i].x, xctx->arc[c][i].y, xctx->arc[c][i].r, xctx->arc[c][i].a, xctx->arc[c][i].b,
|
||||
&tmp.x1, &tmp.y1, &tmp.x2, &tmp.y2);
|
||||
if(!floaters) bbox(ADD, tmp.x1, tmp.y1, tmp.x2, tmp.y2);
|
||||
my_free(_ALLOC_ID_, &xctx->arc[c][i].prop_ptr);
|
||||
deleted = 1;
|
||||
continue;
|
||||
|
|
@ -475,7 +464,6 @@ static void del_rect_line_arc_poly(int floaters)
|
|||
if(k==0 || xctx->poly[c][i].y[k] > y2) y2 = xctx->poly[c][i].y[k];
|
||||
}
|
||||
++j;
|
||||
if(!floaters) bbox(ADD, x1, y1, x2, y2);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].x);
|
||||
my_free(_ALLOC_ID_, &xctx->poly[c][i].y);
|
||||
|
|
@ -495,27 +483,13 @@ static void del_rect_line_arc_poly(int floaters)
|
|||
}
|
||||
|
||||
|
||||
int delete_wires(int floaters, int selected_flag)
|
||||
int delete_wires(int selected_flag)
|
||||
{
|
||||
int i, j = 0, deleted = 0;
|
||||
for(i=0;i<xctx->wires; ++i)
|
||||
{
|
||||
if(xctx->wire[i].sel == selected_flag) {
|
||||
++j;
|
||||
if(xctx->wire[i].bus){
|
||||
double ov, y1, y2;
|
||||
ov = INT_BUS_WIDTH(xctx->lw)> cadhalfdotsize ? INT_BUS_WIDTH(xctx->lw) : CADHALFDOTSIZE;
|
||||
if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; }
|
||||
else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 );
|
||||
} else {
|
||||
double ov, y1, y2;
|
||||
ov = cadhalfdotsize;
|
||||
if(xctx->wire[i].y1 < xctx->wire[i].y2) { y1 = xctx->wire[i].y1-ov; y2 = xctx->wire[i].y2+ov; }
|
||||
else { y1 = xctx->wire[i].y1+ov; y2 = xctx->wire[i].y2-ov; }
|
||||
if(!floaters) bbox(ADD, xctx->wire[i].x1-ov, y1 , xctx->wire[i].x2+ov , y2 );
|
||||
}
|
||||
|
||||
hash_wire(XDELETE, i, 0);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->wire[i].node);
|
||||
|
|
@ -541,46 +515,29 @@ int delete_wires(int floaters, int selected_flag)
|
|||
|
||||
void delete(int to_push_undo)
|
||||
{
|
||||
int i, j, tmp, deleted = 0, floaters;
|
||||
int select_rot = 0, select_flip = 0;
|
||||
int i, j, deleted = 0;
|
||||
#if HAS_CAIRO==1
|
||||
int customfont;
|
||||
#endif
|
||||
double xx1,yy1,xx2,yy2, dtmp;
|
||||
|
||||
floaters = there_are_floaters();
|
||||
dbg(3, "delete(): start\n");
|
||||
j = 0;
|
||||
if(!floaters) bbox(START, 0.0 , 0.0 , 0.0 , 0.0);
|
||||
rebuild_selected_array();
|
||||
if(to_push_undo && xctx->lastsel) xctx->push_undo();
|
||||
/* first calculate bbox, because symbol_bbox() needs translate (@#0:net_name) which
|
||||
* needs prepare_netlist_structs which needs a consistent xctx->inst[] data structure */
|
||||
if(!floaters) find_inst_to_be_redrawn(4 + 32);
|
||||
/* 32: call prepare_netlist_structs(0) if show net names enabled
|
||||
* 4: call symbol_bbox() to precisely update bbox to current zoom level
|
||||
*/
|
||||
del_rect_line_arc_poly(floaters);
|
||||
del_rect_line_arc_poly();
|
||||
|
||||
for(i=0;i<xctx->texts; ++i)
|
||||
{
|
||||
if(xctx->text[i].sel == SELECTED)
|
||||
{
|
||||
select_rot = xctx->text[i].rot;
|
||||
select_flip = xctx->text[i].flip;
|
||||
#if HAS_CAIRO==1
|
||||
customfont = set_text_custom_font(&xctx->text[i]);
|
||||
#endif
|
||||
if(!floaters) text_bbox(get_text_floater(i), xctx->text[i].xscale,
|
||||
xctx->text[i].yscale, (short) select_rot, (short) select_flip, xctx->text[i].hcenter,
|
||||
xctx->text[i].vcenter, xctx->text[i].x0, xctx->text[i].y0,
|
||||
&xx1,&yy1, &xx2,&yy2, &tmp, &dtmp);
|
||||
#if HAS_CAIRO==1
|
||||
if(customfont) {
|
||||
cairo_restore(xctx->cairo_ctx);
|
||||
}
|
||||
#endif
|
||||
if(!floaters) bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].prop_ptr);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].font);
|
||||
my_free(_ALLOC_ID_, &xctx->text[i].floater_instname);
|
||||
|
|
@ -629,31 +586,17 @@ void delete(int to_push_undo)
|
|||
xctx->prep_hi_structs=0;
|
||||
}
|
||||
|
||||
if(delete_wires(floaters, SELECTED)) {
|
||||
if(delete_wires(SELECTED)) {
|
||||
deleted = 1;
|
||||
if(tclgetboolvar("autotrim_wires")) trim_wires();
|
||||
update_conn_cues(WIRELAYER, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
if(xctx->hilight_nets) {
|
||||
propagate_hilights(1, 1, XINSERT_NOREPLACE);
|
||||
}
|
||||
|
||||
if(!floaters) {
|
||||
find_inst_to_be_redrawn(2 + 4 + 8 + 32);
|
||||
/* 32: call prepare_netlist_structs(0)
|
||||
* 2: add previously built list
|
||||
* 4: call symbol_bbox to precisely update bboxes ... needed?
|
||||
* 8: do not iterate over selection (there is no more selection, deleted)
|
||||
*/
|
||||
find_inst_to_be_redrawn(16); /* clear data */
|
||||
}
|
||||
if(deleted) set_modify(1);
|
||||
xctx->lastsel = 0;
|
||||
if(!floaters) bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
if(!floaters) bbox(END , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
xctx->ui_state &= ~SELECTION;
|
||||
set_first_sel(0, -1, 0);
|
||||
}
|
||||
|
|
@ -689,7 +632,7 @@ void delete_only_rect_line_arc_poly(void)
|
|||
bbox(ADD, xx1, yy1, xx2, yy2 );
|
||||
}
|
||||
}
|
||||
del_rect_line_arc_poly(0);
|
||||
del_rect_line_arc_poly();
|
||||
xctx->lastsel = 0;
|
||||
bbox(SET , 0.0 , 0.0 , 0.0 , 0.0);
|
||||
draw();
|
||||
|
|
|
|||
|
|
@ -390,7 +390,6 @@ static void free_xschem_data()
|
|||
my_free(_ALLOC_ID_, &xctx->current_win_path);
|
||||
my_free(_ALLOC_ID_, &xctx->fill_type);
|
||||
my_free(_ALLOC_ID_, &xctx->format);
|
||||
if(xctx->inst_redraw_table) my_free(_ALLOC_ID_, &xctx->inst_redraw_table);
|
||||
my_free(_ALLOC_ID_, &xctx);
|
||||
}
|
||||
|
||||
|
|
@ -479,8 +478,6 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->need_reb_sel_arr = 1;
|
||||
xctx->lastsel = 0;
|
||||
xctx->maxsel = 0;
|
||||
xctx->node_redraw_table.size = 0;
|
||||
xctx->node_redraw_table.table = NULL;
|
||||
xctx->prep_net_structs = 0;
|
||||
xctx->prep_hi_structs = 0;
|
||||
xctx->simdata = NULL;
|
||||
|
|
@ -511,8 +508,6 @@ static void alloc_xschem_data(const char *top_path, const char *win_path)
|
|||
xctx->floater_inst_table.size = 0;
|
||||
xctx->hilight_table = my_calloc(_ALLOC_ID_, HASHSIZE, sizeof(Hilight_hashentry *));
|
||||
|
||||
xctx->inst_redraw_table = NULL;
|
||||
xctx->inst_redraw_table_size = 0;
|
||||
xctx->window = xctx->save_pixmap = 0;
|
||||
xctx->xrect[0].width = xctx->xrect[0].height = xctx->xrect[0].x = xctx->xrect[0].y = 0;
|
||||
#if HAS_CAIRO==1
|
||||
|
|
@ -867,8 +862,6 @@ static void xwin_exit(void)
|
|||
dbg(0, "xwin_exit() double call, doing nothing...\n");
|
||||
return;
|
||||
}
|
||||
tcleval("catch { ngspice::resetdata }"); /* remove ngspice annotation data if any */
|
||||
/* "1" parameter means to force exit even if there are modified tabs/windows */
|
||||
if(xctx->infowindow_text) my_free(_ALLOC_ID_, &xctx->infowindow_text);
|
||||
if(has_x) new_schematic("destroy_all", "1", NULL, 1);
|
||||
delete_schematic_data(1);
|
||||
|
|
|
|||
|
|
@ -976,11 +976,6 @@ typedef struct {
|
|||
int mx_save, my_save, last_command;
|
||||
char sel_or_clip[PATH_MAX];
|
||||
int onetime;
|
||||
/* list of nodes, instances attached to these need redraw */
|
||||
Int_hashtable node_redraw_table;
|
||||
/* list of instances, collected using previous table, that need redraw */
|
||||
unsigned char *inst_redraw_table;
|
||||
int inst_redraw_table_size;
|
||||
/* move.c */
|
||||
double rx1, rx2, ry1, ry2;
|
||||
short move_rot;
|
||||
|
|
@ -1281,7 +1276,7 @@ extern const char *get_sym_template(char *s, char *extra);
|
|||
extern void zoom_full(int draw, int sel, int flags, double shrink);
|
||||
extern void updatebbox(int count,xRect *boundbox,xRect *tmp);
|
||||
extern void draw_selection(GC g, int interruptable);
|
||||
extern int delete_wires(int floaters, int selected_flag);
|
||||
extern int delete_wires(int selected_flag);
|
||||
extern void delete(int to_push_undo);
|
||||
extern void delete_only_rect_line_arc_poly(void);
|
||||
extern void polygon_bbox(double *x, double *y, int points, double *bx1, double *by1, double *bx2, double *by2);
|
||||
|
|
|
|||
|
|
@ -6612,6 +6612,12 @@ proc build_widgets { {topwin {} } } {
|
|||
-command { xschem redraw }
|
||||
$topwin.menubar.option.menu add separator
|
||||
|
||||
$topwin.menubar.option.menu add checkbutton -label "No XCopyArea drawing model" -variable draw_window \
|
||||
-accelerator {Ctrl+$} \
|
||||
-command {
|
||||
if { $draw_window == 1} { xschem set draw_window 1} else { xschem set draw_window 0}
|
||||
}
|
||||
|
||||
$topwin.menubar.option.menu add checkbutton -label "Fix for GPUs with broken tiled fill" \
|
||||
-variable fix_broken_tiled_fill \
|
||||
-command {
|
||||
|
|
@ -6747,11 +6753,6 @@ proc build_widgets { {topwin {} } } {
|
|||
-accelerator {} -command {
|
||||
reset_colors 1
|
||||
}
|
||||
$topwin.menubar.view.menu add checkbutton -label "No XCopyArea drawing model" -variable draw_window \
|
||||
-accelerator {Ctrl+$} \
|
||||
-command {
|
||||
if { $draw_window == 1} { xschem set draw_window 1} else { xschem set draw_window 0}
|
||||
}
|
||||
|
||||
$topwin.menubar.view.menu add checkbutton -label "Toggle variable line width" -variable change_lw \
|
||||
-accelerator {_}
|
||||
|
|
|
|||
Loading…
Reference in New Issue