[Experimental Feature Update (orthogonal_wiring)]: Modified the last added orthogonal wiring mode to only draw either a horizontal, or a vertical component when a user-click event is detected. To get the best experience with this feature, 'persistent_commands' should also be enabled from the 'Options' menu.
This commit is contained in:
parent
3b55410709
commit
f020e45364
|
|
@ -85,16 +85,20 @@ static int waves_selected(int event, KeySym key, int state, int button)
|
||||||
void redraw_w_a_l_r_p_rubbers(void)
|
void redraw_w_a_l_r_p_rubbers(void)
|
||||||
{
|
{
|
||||||
if(xctx->ui_state & STARTWIRE) {
|
if(xctx->ui_state & STARTWIRE) {
|
||||||
if(xctx->constr_mv == 1) xctx->mousey_snap = xctx->my_double_save;
|
|
||||||
if(xctx->constr_mv == 2) xctx->mousex_snap = xctx->mx_double_save;
|
|
||||||
if(tclgetboolvar("orthogonal_wiring")) {
|
if(tclgetboolvar("orthogonal_wiring")) {
|
||||||
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
|
||||||
int tmp_x2 = xctx->nl_x2 - xctx->nl_x1, tmp_y2 = xctx->nl_y2 - xctx->nl_y1;
|
int tmp_x2 = xctx->nl_x2 - xctx->nl_x1, tmp_y2 = xctx->nl_y2 - xctx->nl_y1;
|
||||||
if(tmp_x2*tmp_x2 > tmp_y2*tmp_y2) xctx->manhattan_lines = 1;
|
if(tmp_x2*tmp_x2 > tmp_y2*tmp_y2){
|
||||||
else xctx->manhattan_lines = 2;
|
tcleval("set constr_mv 1");
|
||||||
new_wire(RUBBER, xctx->mousex_snap, xctx->mousey_snap);
|
xctx->constr_mv = 1;
|
||||||
|
} else {
|
||||||
|
tcleval("set constr_mv 2");
|
||||||
|
xctx->constr_mv = 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else new_wire(RUBBER, xctx->mousex_snap, xctx->mousey_snap);
|
if(xctx->constr_mv == 1) xctx->mousey_snap = xctx->my_double_save;
|
||||||
|
if(xctx->constr_mv == 2) xctx->mousex_snap = xctx->mx_double_save;
|
||||||
|
new_wire(RUBBER, xctx->mousex_snap, xctx->mousey_snap);
|
||||||
}
|
}
|
||||||
if(xctx->ui_state & STARTARC) {
|
if(xctx->ui_state & STARTARC) {
|
||||||
if(xctx->constr_mv == 1) xctx->mousey_snap = xctx->my_double_save;
|
if(xctx->constr_mv == 1) xctx->mousey_snap = xctx->my_double_save;
|
||||||
|
|
@ -3333,10 +3337,11 @@ int rstate; /* (reduced state, without ShiftMask) */
|
||||||
if(key=='L' && rstate == 0) { /* toggle orthogonal routing */
|
if(key=='L' && rstate == 0) { /* toggle orthogonal routing */
|
||||||
if(tclgetboolvar("orthogonal_wiring")){
|
if(tclgetboolvar("orthogonal_wiring")){
|
||||||
tclsetboolvar("orthogonal_wiring", 0);
|
tclsetboolvar("orthogonal_wiring", 0);
|
||||||
|
tcleval("set constr_mv 0");
|
||||||
|
xctx->constr_mv = 0;
|
||||||
} else {
|
} else {
|
||||||
tclsetboolvar("orthogonal_wiring", 1);
|
tclsetboolvar("orthogonal_wiring", 1);
|
||||||
}
|
}
|
||||||
xctx->manhattan_lines = 0;
|
|
||||||
redraw_w_a_l_r_p_rubbers();
|
redraw_w_a_l_r_p_rubbers();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8067,7 +8067,7 @@ proc build_widgets { {topwin {} } } {
|
||||||
-selectcolor $selectcolor -accelerator Y
|
-selectcolor $selectcolor -accelerator Y
|
||||||
$topwin.menubar.option add checkbutton -label "Enable infix-wire" -variable infix_wire \
|
$topwin.menubar.option add checkbutton -label "Enable infix-wire" -variable infix_wire \
|
||||||
-selectcolor $selectcolor
|
-selectcolor $selectcolor
|
||||||
$topwin.menubar.option add checkbutton -label "Enable orthogonal wiring mode" -variable orthogonal_wiring \
|
$topwin.menubar.option add checkbutton -label "Enable orthogonal wiring" -variable orthogonal_wiring \
|
||||||
-selectcolor $selectcolor -accelerator Shift+L
|
-selectcolor $selectcolor -accelerator Shift+L
|
||||||
$topwin.menubar.option add checkbutton -label "Unsel. partial sel. wires after stretch move" \
|
$topwin.menubar.option add checkbutton -label "Unsel. partial sel. wires after stretch move" \
|
||||||
-selectcolor $selectcolor -variable unselect_partial_sel_wires
|
-selectcolor $selectcolor -variable unselect_partial_sel_wires
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue