diff --git a/src/callback.c b/src/callback.c index ce06be22..34376a8e 100644 --- a/src/callback.c +++ b/src/callback.c @@ -2245,7 +2245,7 @@ int draw_xhair = tclgetboolvar("draw_crosshair"); { xctx->mx_double_save=xctx->mousex_snap; xctx->my_double_save=xctx->mousey_snap; - tclsetintvar("connect_by_kissing", 2); /* 2 will be used to reset var to 0 at end of move */ + xctx->connect_by_kissing = 2; /* 2 will be used to reset var to 0 at end of move */ /* select_attached_nets(); */ /* stretch nets that land on selected instance pins */ move_objects(START,0,0,0); break; @@ -2265,7 +2265,7 @@ int draw_xhair = tclgetboolvar("draw_crosshair"); !(xctx->ui_state & (STARTMOVE | STARTCOPY))) { if(xctx->semaphore >= 2) break; - tclsetintvar("connect_by_kissing", 2); /* 2 will be used to reset var to 0 at end of move */ + xctx->connect_by_kissing = 2; /* 2 will be used to reset var to 0 at end of move */ xctx->mx_double_save=xctx->mousex_snap; xctx->my_double_save=xctx->mousey_snap; copy_objects(START); diff --git a/src/move.c b/src/move.c index abe9c41c..102ca718 100644 --- a/src/move.c +++ b/src/move.c @@ -658,7 +658,7 @@ void copy_objects(int what) xctx->rotatelocal=0; dbg(1, "copy_objects(): START copy\n"); rebuild_selected_array(); - if(tclgetintvar("connect_by_kissing") == 2) xctx->kissing = connect_by_kissing(); + if(xctx->connect_by_kissing == 2) xctx->kissing = connect_by_kissing(); else xctx->kissing = 0; save_selection(1); @@ -675,7 +675,7 @@ void copy_objects(int what) if(xctx->kissing) { pop_undo(0, 0); - if(tclgetintvar("connect_by_kissing") == 2) tclsetintvar("connect_by_kissing", 0); + if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0; } if(fix_broken_tiled_fill || !_unix) { @@ -719,9 +719,7 @@ void copy_objects(int what) int floaters = there_are_floaters(); - if(tclgetintvar("connect_by_kissing") == 2) { - tclsetintvar("connect_by_kissing", 0); - } + 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; @@ -1106,7 +1104,7 @@ void move_objects(int what, int merge, double dx, double dy) xctx->deltax = xctx->deltay = 0.0; rebuild_selected_array(); /* if connect_by_kissing==2 it was set in callback.c ('M' command) */ - if(tclgetintvar("connect_by_kissing")) xctx->kissing = connect_by_kissing(); + if(xctx->connect_by_kissing == 2) xctx->kissing = connect_by_kissing(); else xctx->kissing = 0; xctx->movelastsel = xctx->lastsel; if(xctx->lastsel==1 && xctx->sel_array[0].type==ARC && @@ -1122,7 +1120,7 @@ void move_objects(int what, int merge, double dx, double dy) draw_selection(xctx->gctiled,0); if(xctx->kissing) { pop_undo(0, 0); - if(tclgetintvar("connect_by_kissing") == 2) tclsetintvar("connect_by_kissing", 0); + if(xctx->connect_by_kissing == 2) xctx->connect_by_kissing = 0; } if(fix_broken_tiled_fill || !_unix) { if(xctx->save_pixmap && xctx->window) @@ -1161,9 +1159,7 @@ void move_objects(int what, int merge, double dx, double dy) int firsti, firstw; int floaters = there_are_floaters(); - if(tclgetintvar("connect_by_kissing") == 2) { - tclsetintvar("connect_by_kissing", 0); - } + 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)) ) { diff --git a/src/scheduler.c b/src/scheduler.c index 38f09605..3185a693 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2454,7 +2454,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } } if(stretch) select_attached_nets(); - if(kissing) tclsetintvar("connect_by_kissing", 2); + if(kissing) xctx->connect_by_kissing = 2; if(argc > 3 + nparam) { move_objects(START,0,0,0); move_objects( END,0,atof(argv[2]), atof(argv[3])); diff --git a/src/token.c b/src/token.c index c503b305..03ecdc26 100644 --- a/src/token.c +++ b/src/token.c @@ -139,10 +139,6 @@ const char *tcl_hook2(const char *cmd) return result; } -/* Missing: - * if one instance is named R1[3:0] and another is named R1[2] - * the name collision is not detected nor corrected - */ void check_unique_names(int rename) { int i, first = 1, modified = 0; diff --git a/src/xinit.c b/src/xinit.c index 3bfce5ee..093ad942 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -531,6 +531,8 @@ static void alloc_xschem_data(const char *top_path, const char *win_path) xctx->move_rot = 0; xctx->move_flip = 0; xctx->manhattan_lines = 0; + xctx->kissing = 0; + xctx->connect_by_kissing = 0; xctx->x1 = xctx->y_1 = xctx->x2 = xctx->y_2 = xctx->deltax = xctx->deltay = 0.0; xctx->movelastsel = 0; xctx->rotatelocal=0; diff --git a/src/xschem.h b/src/xschem.h index af44fe2a..c93dd4ad 100644 --- a/src/xschem.h +++ b/src/xschem.h @@ -946,6 +946,8 @@ typedef struct { /* move.c */ double rx1, rx2, ry1, ry2; short move_rot; + /* connect by kissing enable flag */ + int connect_by_kissing; /* a wire was created while separating a component frm a net or another component */ int kissing; short move_flip; diff --git a/src/xschem.tcl b/src/xschem.tcl index cd9efc0c..cfb4b603 100644 --- a/src/xschem.tcl +++ b/src/xschem.tcl @@ -5588,7 +5588,7 @@ set tctx::global_list { INITIALINSTDIR INITIALLOADDIR INITIALPROPDIR INITIALTEXTDIR XSCHEM_LIBRARY_PATH add_all_windows_drives auto_hilight autofocus_mainwindow autotrim_wires bespice_listen_port big_grid_points bus_replacement_char cadgrid cadlayers - cadsnap cairo_font_name change_lw color_ps colors compare_sch connect_by_kissing constrained_move + cadsnap cairo_font_name change_lw color_ps colors compare_sch constrained_move copy_cell custom_label_prefix custom_token dark_colors dark_colorscheme delay_flag dim_bg dim_value disable_unique_names do_all_inst draw_crosshair draw_grid draw_window edit_prop_pos edit_prop_size @@ -6775,7 +6775,6 @@ set_ne show_hidden_texts 0 set_ne incr_hilight 1 set_ne enable_stretch 0 set_ne constrained_move 0 -set_ne connect_by_kissing 0 set_ne unselect_partial_sel_wires 0 set_ne draw_crosshair 0 set_ne draw_grid 1 diff --git a/src/xschemrc b/src/xschemrc index b092b74a..d2cc02c4 100644 --- a/src/xschemrc +++ b/src/xschemrc @@ -177,10 +177,6 @@ #### default: 0 # set persistent_command 1 -#### if set to 1 a wire is inserted when separating components that are -#### connected by pins. Default: not enabled (0) -# set connect_by_kissing 1 - #### if set to 1 at end of a move operation that stretches wires attached to #### moved objects these wires will be unselected. #### default: not enabled (0)