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