drawtemp_manhattanline(): use local nl_xx[12] and nl_yy[12] variables, since xctx->nl_xx[12] and xctx->nl_yy[12] are used also in select_rect() which calls draw_selection() which calls drawtemp_manhattanline().

This commit is contained in:
stefan schippers 2025-03-16 05:15:40 +01:00
parent 2f26544c45
commit a0a5d9876f
1 changed files with 21 additions and 20 deletions

View File

@ -1377,6 +1377,7 @@ void drawtempline(GC gc, int what, double linex1,double liney1,double linex2,dou
void drawtemp_manhattanline(GC gc, int what, double x1, double y1, double x2, double y2)
{
double nl_xx1, nl_yy1, nl_xx2, nl_yy2;
double origin_shifted_x2, origin_shifted_y2;
if(tclgetboolvar("orthogonal_wiring")) {
/* Origin shift the cartesian coordinate p2(x2,y2) w.r.t. p1(x1,y1) */
@ -1389,28 +1390,28 @@ void drawtemp_manhattanline(GC gc, int what, double x1, double y1, double x2, do
xctx->manhattan_lines = 2;
}
if(xctx->manhattan_lines & 1) {
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy1);
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
ORDER(xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
drawtempline(gc, what, xctx->nl_xx2,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
nl_xx1 = x1; nl_yy1 = y1;
nl_xx2 = x2; nl_yy2 = y2;
ORDER(nl_xx1,nl_yy1,nl_xx2,nl_yy1);
drawtempline(gc, what, nl_xx1,nl_yy1,nl_xx2,nl_yy1);
nl_xx1 = x1; nl_yy1 = y1;
nl_xx2 = x2; nl_yy2 = y2;
ORDER(nl_xx2,nl_yy1,nl_xx2,nl_yy2);
drawtempline(gc, what, nl_xx2,nl_yy1,nl_xx2,nl_yy2);
} else if(xctx->manhattan_lines & 2) {
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx1,xctx->nl_yy2);
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
ORDER(xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy2,xctx->nl_xx2,xctx->nl_yy2);
nl_xx1 = x1; nl_yy1 = y1;
nl_xx2 = x2; nl_yy2 = y2;
ORDER(nl_xx1,nl_yy1,nl_xx1,nl_yy2);
drawtempline(gc, what, nl_xx1,nl_yy1,nl_xx1,nl_yy2);
nl_xx1 = x1; nl_yy1 = y1;
nl_xx2 = x2; nl_yy2 = y2;
ORDER(nl_xx1,nl_yy2,nl_xx2,nl_yy2);
drawtempline(gc, what, nl_xx1,nl_yy2,nl_xx2,nl_yy2);
} else {
xctx->nl_xx1 = x1; xctx->nl_yy1 = y1;
xctx->nl_xx2 = x2; xctx->nl_yy2 = y2;
ORDER(xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
drawtempline(gc, what, xctx->nl_xx1,xctx->nl_yy1,xctx->nl_xx2,xctx->nl_yy2);
nl_xx1 = x1; nl_yy1 = y1;
nl_xx2 = x2; nl_yy2 = y2;
ORDER(nl_xx1,nl_yy1,nl_xx2,nl_yy2);
drawtempline(gc, what, nl_xx1,nl_yy1,nl_xx2,nl_yy2);
}
}