[Experimental Feature Update]: Orthogonal wiring feature is now applicable to wires connected to objects, when those objects are moved to a different position by the user. This requires 'enable_stretching' to be enabled, which will stretch the connected wires orthogonally when the user drags/moves objects around in the canvas.
This commit is contained in:
parent
5d48446d42
commit
a3eb1b0c17
74
src/move.c
74
src/move.c
|
|
@ -1141,60 +1141,30 @@ void move_objects(int what, int merge, double dx, double dy)
|
|||
if(xctx->manhattan_lines & 1) xctx->manhattan_lines=2;
|
||||
else if(xctx->manhattan_lines & 2) xctx->manhattan_lines=1;
|
||||
}
|
||||
wire[n].sel = SELECTED;
|
||||
delete_wires(SELECTED);
|
||||
if(xctx->manhattan_lines & 1) {
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
xctx->nl_xx1 = xctx->rx1; xctx->nl_yy1 = xctx->ry1;
|
||||
xctx->nl_xx2 = xctx->rx2; xctx->nl_yy2 = xctx->ry2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1,WIRE,0,0,NULL);
|
||||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1, 0, NULL);
|
||||
}
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
xctx->nl_xx1 = xctx->rx1; xctx->nl_yy1 = xctx->ry1;
|
||||
xctx->nl_xx2 = xctx->rx2; xctx->nl_yy2 = xctx->ry2;
|
||||
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2,WIRE,0,0,NULL);
|
||||
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) {
|
||||
if(xctx->nl_yy2!=xctx->nl_yy1) {
|
||||
xctx->nl_xx1 = xctx->rx1; xctx->nl_yy1 = xctx->ry1;
|
||||
xctx->nl_xx2 = xctx->rx2; xctx->nl_yy2 = xctx->ry2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2,WIRE,0,0,NULL);
|
||||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2, 0, NULL);
|
||||
}
|
||||
if(xctx->nl_xx2!=xctx->nl_xx1) {
|
||||
xctx->nl_xx1 = xctx->rx1; xctx->nl_yy1 = xctx->ry1;
|
||||
xctx->nl_xx2 = xctx->rx2; xctx->nl_yy2 = xctx->ry2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2,WIRE,0,0,NULL);
|
||||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2, 0, NULL);
|
||||
}
|
||||
} else {
|
||||
xctx->nl_xx1 = xctx->rx1; xctx->nl_yy1 = xctx->ry1;
|
||||
xctx->nl_xx2 = xctx->rx2; xctx->nl_yy2 = xctx->ry2;
|
||||
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
|
||||
storeobject(-1, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2,WIRE,0,0,NULL);
|
||||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,NOW, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2, 0, NULL);
|
||||
wire[n].x1 = xctx->rx1;
|
||||
wire[n].y1 = xctx->ry1;
|
||||
if(xctx->manhattan_lines&1)
|
||||
{
|
||||
wire[n].x2 = xctx->rx2;
|
||||
wire[n].y2 = xctx->ry1;
|
||||
storeobject(-1, xctx->rx2,xctx->ry1,xctx->rx2,xctx->ry2,WIRE,0,0,NULL);
|
||||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,ADD, xctx->rx2,xctx->ry1,xctx->rx2,xctx->ry2, 0, NULL);
|
||||
}
|
||||
xctx->prep_hi_structs = 0;
|
||||
if(tclgetboolvar("autotrim_wires")) trim_wires();
|
||||
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(xctx->hilight_nets) {
|
||||
propagate_hilights(1, 1, XINSERT_NOREPLACE);
|
||||
else if(xctx->manhattan_lines&2)
|
||||
{
|
||||
wire[n].x2 = xctx->rx1;
|
||||
wire[n].y2 = xctx->ry2;
|
||||
storeobject(-1, xctx->rx1,xctx->ry2,xctx->rx2,xctx->ry2,WIRE,0,0,NULL);
|
||||
hash_wire(XINSERT, xctx->wires-1, 1);
|
||||
drawline(WIRELAYER,ADD, xctx->rx1,xctx->ry2,xctx->rx2,xctx->ry2, 0, NULL);
|
||||
}
|
||||
draw();
|
||||
/* draw_hilight_net(1);*/ /* for updating connection bubbles on hilight nets */
|
||||
set_modify(1);
|
||||
else
|
||||
{
|
||||
wire[n].x2 = xctx->rx2;
|
||||
wire[n].y2 = xctx->ry2;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue