From a0a5d9876fe23d1da540875b662b778a81d3f227 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Sun, 16 Mar 2025 05:15:40 +0100 Subject: [PATCH] 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(). --- src/draw.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/draw.c b/src/draw.c index c6bbeabe..7807fd45 100644 --- a/src/draw.c +++ b/src/draw.c @@ -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); } }