align callback.c with SuperCD fork

This commit is contained in:
stefan schippers 2025-03-16 19:56:57 +01:00
parent 33591fa41d
commit 50321ae480
1 changed files with 7 additions and 7 deletions

View File

@ -107,6 +107,7 @@ void redraw_w_a_l_r_p_z_rubbers(int force)
{
double mx = xctx->mousex_snap;
double my = xctx->mousey_snap;
double origin_shifted_x2, origin_shifted_y2;
if(!force && xctx->mousex_snap == xctx->prev_rubberx && xctx->mousey_snap == xctx->prev_rubbery) return;
@ -115,12 +116,11 @@ void redraw_w_a_l_r_p_z_rubbers(int force)
if(xctx->constr_mv == 1) my = xctx->my_double_save;
if(xctx->constr_mv == 2) mx = xctx->mx_double_save;
if(tclgetboolvar("orthogonal_wiring")) {
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
double origin_shifted_x2 = xctx->nl_x2 - xctx->nl_x1;
double origin_shifted_y2 = xctx->nl_y2 - xctx->nl_y1;
new_wire(RUBBER|CLEAR, xctx->mousex_snap, xctx->mousey_snap);
/* Draw whichever component of the resulting orthogonal-wire is bigger
* (either horizontal or vertical), first */
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
origin_shifted_x2 = xctx->nl_x2 - xctx->nl_x1;
origin_shifted_y2 = xctx->nl_y2 - xctx->nl_y1;
/* Draw whichever component of the resulting orthogonal-wire is bigger (either horizontal or vertical), first */
if(origin_shifted_x2*origin_shifted_x2 > origin_shifted_y2*origin_shifted_y2){
xctx->manhattan_lines = 1;
} else {
@ -4507,8 +4507,8 @@ static void handle_double_click(int event, int state, KeySym key, int button,
} else {
if(xctx->ui_state & STARTWIRE) {
if( cadence_compat ) {
redraw_w_a_l_r_p_z_rubbers(1);
start_wire(mx, my);
redraw_w_a_l_r_p_z_rubbers(1);
start_wire(mx, my);
}
xctx->ui_state &= ~STARTWIRE;
}