[Revert changes]
This commit is contained in:
parent
8c1bfc93f6
commit
3556f3599c
|
|
@ -3019,7 +3019,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
if( (what & PLACE) ) {
|
||||
if( (xctx->ui_state & STARTWIRE) && (xctx->nl_x1!=xctx->nl_x2 || xctx->nl_y1!=xctx->nl_y2) ) {
|
||||
xctx->push_undo();
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->manhattan_lines==1) {
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
|
|
@ -3038,7 +3038,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0, NULL);
|
||||
}
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
} else if(xctx->manhattan_lines==2) {
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
|
|
@ -3076,8 +3076,6 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
draw();
|
||||
/* draw_hilight_net(1);*/ /* for updating connection bubbles on hilight nets */
|
||||
}
|
||||
|
||||
#if 0
|
||||
if(! (what &END)) {
|
||||
xctx->nl_x1=mx_snap;
|
||||
xctx->nl_y1=my_snap;
|
||||
|
|
@ -3087,7 +3085,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
xctx->nl_yy1=xctx->nl_y1;
|
||||
xctx->nl_xx2=xctx->mousex_snap;
|
||||
xctx->nl_yy2=xctx->mousey_snap;
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->manhattan_lines==1) {
|
||||
xctx->nl_x2 = mx_snap; xctx->nl_y2 = my_snap;
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
|
|
@ -3097,7 +3095,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(xctx->gc[WIRELAYER], NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
} else if(xctx->manhattan_lines==2) {
|
||||
xctx->nl_x2 = mx_snap; xctx->nl_y2 = my_snap;
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
|
|
@ -3115,8 +3113,6 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
drawtempline(xctx->gc[WIRELAYER], NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
xctx->nl_x1 = xctx->nl_x2=mx_snap; xctx->nl_y1 = xctx->nl_y2=my_snap;
|
||||
xctx->ui_state |= STARTWIRE;
|
||||
if(modified) set_modify(1);
|
||||
}
|
||||
|
|
@ -3124,7 +3120,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
xctx->ui_state &= ~STARTWIRE;
|
||||
}
|
||||
if( (what & RUBBER) ) {
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->manhattan_lines==1) {
|
||||
xctx->nl_xx1=xctx->nl_x1;xctx->nl_yy1=xctx->nl_y1;
|
||||
xctx->nl_xx2=xctx->nl_x2;xctx->nl_yy2=xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
|
|
@ -3145,7 +3141,7 @@ void new_wire(int what, double mx_snap, double my_snap)
|
|||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(xctx->gc[WIRELAYER], NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
} else if(xctx->manhattan_lines==2) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
|
|
@ -3315,7 +3311,7 @@ void new_line(int what, double mousex_snap, double mousey_snap)
|
|||
if( (xctx->nl_x1!=xctx->nl_x2 || xctx->nl_y1!=xctx->nl_y2) && (xctx->ui_state & STARTLINE) )
|
||||
{
|
||||
xctx->push_undo();
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->manhattan_lines==1) {
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
|
|
@ -3332,7 +3328,7 @@ void new_line(int what, double mousex_snap, double mousey_snap)
|
|||
modified = 1;
|
||||
drawline(xctx->rectcolor,NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0, NULL);
|
||||
}
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
} else if(xctx->manhattan_lines==2) {
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
|
|
@ -3369,7 +3365,7 @@ void new_line(int what, double mousex_snap, double mousey_snap)
|
|||
|
||||
if(what & RUBBER)
|
||||
{
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->manhattan_lines==1) {
|
||||
xctx->nl_xx1 = xctx->nl_x1;xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2;xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
|
|
@ -3390,7 +3386,7 @@ void new_line(int what, double mousex_snap, double mousey_snap)
|
|||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
drawtempline(xctx->gc[xctx->rectcolor], NOW, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
}
|
||||
} else if(xctx->manhattan_lines & 2) {
|
||||
} else if(xctx->manhattan_lines==2) {
|
||||
xctx->nl_xx1 = xctx->nl_x1; xctx->nl_yy1 = xctx->nl_y1;
|
||||
xctx->nl_xx2 = xctx->nl_x2; xctx->nl_yy2 = xctx->nl_y2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
|
|
|
|||
|
|
@ -1593,25 +1593,6 @@ static int end_place_move_copy_zoom()
|
|||
return 0;
|
||||
}
|
||||
|
||||
void snapped_wire(double c_snap)
|
||||
{
|
||||
double x, y;
|
||||
if(!(xctx->ui_state & STARTWIRE)){
|
||||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
xctx->mx_double_save = my_round(x / c_snap) * c_snap;
|
||||
xctx->my_double_save = my_round(y / c_snap) * c_snap;
|
||||
new_wire(PLACE, x, y);
|
||||
new_wire(RUBBER, xctx->mousex_snap,xctx->mousey_snap);
|
||||
}
|
||||
else {
|
||||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
new_wire(RUBBER, x, y);
|
||||
new_wire(PLACE|END, x, y);
|
||||
xctx->constr_mv=0;
|
||||
tcleval("set constr_mv 0" );
|
||||
}
|
||||
}
|
||||
|
||||
static int check_menu_start_commands(double c_snap)
|
||||
{
|
||||
dbg(1, "check_menu_start_commands(): ui_state=%x, ui_state2=%x last_command=%d\n",
|
||||
|
|
@ -1619,10 +1600,12 @@ static int check_menu_start_commands(double c_snap)
|
|||
|
||||
if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTWIRECUT)) {
|
||||
break_wires_at_point(xctx->mousex_snap, xctx->mousey_snap, 1);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTWIRECUT2)) {
|
||||
break_wires_at_point(xctx->mousex_snap, xctx->mousey_snap, 0);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTMOVE)) {
|
||||
|
|
@ -1631,12 +1614,14 @@ static int check_menu_start_commands(double c_snap)
|
|||
/* stretch nets that land on selected instance pins if connect_by_kissing == 2 */
|
||||
/* select_attached_nets(); */
|
||||
move_objects(START,0,0,0);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTCOPY)) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
copy_objects(START);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTWIRE)) {
|
||||
|
|
@ -1647,6 +1632,8 @@ static int check_menu_start_commands(double c_snap)
|
|||
tcleval("set constr_mv 0" );
|
||||
xctx->constr_mv=0;
|
||||
}
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
xctx->ui_state2 = 0;
|
||||
|
||||
/*
|
||||
* xctx->mx_double_save=xctx->mousex_snap;
|
||||
|
|
@ -1657,7 +1644,13 @@ static int check_menu_start_commands(double c_snap)
|
|||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTSNAPWIRE)) {
|
||||
snapped_wire(c_snap);
|
||||
double x, y;
|
||||
|
||||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
xctx->mx_double_save = my_round(x / c_snap) * c_snap;
|
||||
xctx->my_double_save = my_round(y / c_snap) * c_snap;
|
||||
new_wire(PLACE, x, y);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTLINE)) {
|
||||
|
|
@ -1668,6 +1661,8 @@ static int check_menu_start_commands(double c_snap)
|
|||
tcleval("set constr_mv 0" );
|
||||
xctx->constr_mv=0;
|
||||
}
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
xctx->ui_state2 = 0;
|
||||
|
||||
/*
|
||||
* xctx->mx_double_save=xctx->mousex_snap;
|
||||
|
|
@ -1681,28 +1676,33 @@ static int check_menu_start_commands(double c_snap)
|
|||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
new_rect(PLACE,xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTPOLYGON)) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
new_polygon(PLACE, xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTARC)) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
new_arc(PLACE, 180., xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTCIRCLE)) {
|
||||
xctx->mx_double_save=xctx->mousex_snap;
|
||||
xctx->my_double_save=xctx->mousey_snap;
|
||||
new_arc(PLACE, 360., xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
else if((xctx->ui_state & MENUSTART) && (xctx->ui_state2 & MENUSTARTZOOM)) {
|
||||
zoom_rectangle(START);
|
||||
xctx->ui_state &=~MENUSTART;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -2300,6 +2300,25 @@ static int grabscreen(const char *winpath, int event, int mx, int my, KeySym key
|
|||
}
|
||||
#endif
|
||||
|
||||
static void snapped_wire(double c_snap)
|
||||
{
|
||||
double x, y;
|
||||
if(!(xctx->ui_state & STARTWIRE)){
|
||||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
xctx->mx_double_save = my_round(x / c_snap) * c_snap;
|
||||
xctx->my_double_save = my_round(y / c_snap) * c_snap;
|
||||
new_wire(PLACE, x, y);
|
||||
new_wire(RUBBER, xctx->mousex_snap,xctx->mousey_snap);
|
||||
}
|
||||
else {
|
||||
find_closest_net_or_symbol_pin(xctx->mousex, xctx->mousey, &x, &y);
|
||||
new_wire(RUBBER, x, y);
|
||||
new_wire(PLACE|END, x, y);
|
||||
xctx->constr_mv=0;
|
||||
tcleval("set constr_mv 0" );
|
||||
}
|
||||
}
|
||||
|
||||
/* main window callback */
|
||||
/* mx and my are set to the mouse coord. relative to window */
|
||||
/* winpath: set to .drw or sub windows .x1.drw, .x2.drw, ... */
|
||||
|
|
@ -2608,8 +2627,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
}
|
||||
/* snap crosshair to closest pin or net endpoint */
|
||||
if(draw_xhair) {
|
||||
if( ( (xctx->ui_state & (MENUSTART | STARTWIRE) ) || xctx->ui_state == 0 ) &&
|
||||
(state == ShiftMask) ) {
|
||||
if( ( (xctx->ui_state & STARTWIRE) || xctx->ui_state == 0 ) && (state & ShiftMask) ) {
|
||||
double x, y, sx, sy;
|
||||
sx = xctx->mousex_snap;
|
||||
sy = xctx->mousey_snap;
|
||||
|
|
@ -2637,7 +2655,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
xctx->manhattan_lines %=3;
|
||||
new_wire(RUBBER, xctx->mousex_snap, xctx->mousey_snap);
|
||||
|
||||
} else if(xctx->ui_state & STARTLINE) {
|
||||
} else if(xctx->ui_state==STARTLINE) {
|
||||
new_line(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||
xctx->manhattan_lines++;
|
||||
xctx->manhattan_lines %=3;
|
||||
|
|
@ -2866,12 +2884,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
}
|
||||
if(key== 'W' /* && !xctx->ui_state */ && rstate == 0) { /* create wire snapping to closest instance pin */
|
||||
if(xctx->semaphore >= 2) break;
|
||||
if(infix_interface) {
|
||||
snapped_wire(c_snap);
|
||||
} else {
|
||||
xctx->ui_state |= MENUSTART;
|
||||
xctx->ui_state2 = MENUSTARTSNAPWIRE;
|
||||
}
|
||||
snapped_wire(c_snap);
|
||||
break;
|
||||
}
|
||||
if(key == 'w' /* && !xctx->ui_state */ && rstate==0) /* place wire. */
|
||||
|
|
@ -4178,6 +4191,7 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
/* terminate wire placement in snap mode */
|
||||
else if(button==Button1 && (state & ShiftMask) && (xctx->ui_state & STARTWIRE) ) {
|
||||
snapped_wire(c_snap);
|
||||
here(1111);
|
||||
}
|
||||
/* Alt - Button1 click to unselect */
|
||||
else if(button==Button1 && (SET_MODMASK) ) {
|
||||
|
|
@ -4351,12 +4365,11 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
xctx->semaphore = savesem;
|
||||
}
|
||||
|
||||
/* end wire creation when dragging in intuitive interface from an inst pin or wire endpoint */
|
||||
else if(state == Button1Mask && xctx->intuitive_interface &&
|
||||
(xctx->ui_state & STARTWIRE) && !(xctx->ui_state & MENUSTART)) {
|
||||
/* end wire creation when dragging in intuitive interface from an inst pin ow wire endpoint */
|
||||
else if(state == Button1Mask && xctx->intuitive_interface && (xctx->ui_state & STARTWIRE)) {
|
||||
if(end_place_move_copy_zoom()) break;
|
||||
}
|
||||
|
||||
|
||||
/* end intuitive_interface copy or move */
|
||||
if(xctx->ui_state & STARTCOPY && xctx->drag_elements) {
|
||||
copy_objects(END);
|
||||
|
|
@ -4404,13 +4417,6 @@ int rstate; /* (reduced state, without ShiftMask) */
|
|||
xctx->mousex_snap, xctx->mousey_snap, xctx->lastsel, xctx->sch_path[xctx->currsch] );
|
||||
statusmsg(str,1);
|
||||
}
|
||||
|
||||
/* clear start from menu flag or infix_interface=0 start commands */
|
||||
if(xctx->ui_state & MENUSTART) {
|
||||
xctx->ui_state &= ~MENUSTART;
|
||||
break;
|
||||
}
|
||||
|
||||
if(draw_xhair) draw_crosshair(0);
|
||||
if(snap_cursor && wire_draw_active) draw_snap_cursor(0);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1393,7 +1393,6 @@ extern int Tcl_AppInit(Tcl_Interp *interp);
|
|||
extern void abort_operation(void);
|
||||
extern void draw_crosshair(int what);
|
||||
extern void backannotate_at_cursor_b_pos(xRect *r, Graph_ctx *gr);
|
||||
/* extern void snapped_wire(double c_snap); */
|
||||
extern int callback(const char *winpath, int event, int mx, int my, KeySym key,
|
||||
int button, int aux, int state);
|
||||
extern void resetwin(int create_pixmap, int clear_pixmap, int force, int w, int h);
|
||||
|
|
|
|||
Loading…
Reference in New Issue