From 320aa96f98cc38446f498c5b71dd8554dc693bd2 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Thu, 3 Apr 2025 01:54:21 +0200 Subject: [PATCH] fix regression: constrained move (V/H) when creating polygons --- src/actions.c | 26 +++++++++++++------------- src/scheduler.c | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/actions.c b/src/actions.c index f6608b07..bd284fbe 100644 --- a/src/actions.c +++ b/src/actions.c @@ -3415,10 +3415,10 @@ void new_polygon(int what, double mousex_snap, double mousey_snap) } if( what & ADD) { - if(xctx->mousex_snap < xctx->nl_x1) xctx->nl_x1 = xctx->mousex_snap; - if(xctx->mousex_snap > xctx->nl_x2) xctx->nl_x2 = xctx->mousex_snap; - if(xctx->mousey_snap < xctx->nl_y1) xctx->nl_y1 = xctx->mousey_snap; - if(xctx->mousey_snap > xctx->nl_y2) xctx->nl_y2 = xctx->mousey_snap; + if(mousex_snap < xctx->nl_x1) xctx->nl_x1 = mousex_snap; + if(mousex_snap > xctx->nl_x2) xctx->nl_x2 = mousex_snap; + if(mousey_snap < xctx->nl_y1) xctx->nl_y1 = mousey_snap; + if(mousey_snap > xctx->nl_y2) xctx->nl_y2 = mousey_snap; /* closed poly */ if(what & END) { /* delete last rubber */ @@ -3428,8 +3428,8 @@ void new_polygon(int what, double mousex_snap, double mousey_snap) /* add point */ } else if(xctx->nl_polyx[xctx->nl_points] != xctx->nl_polyx[xctx->nl_points-1] || xctx->nl_polyy[xctx->nl_points] != xctx->nl_polyy[xctx->nl_points-1]) { - xctx->nl_polyx[xctx->nl_points] = xctx->mousex_snap; - xctx->nl_polyy[xctx->nl_points] = xctx->mousey_snap; + xctx->nl_polyx[xctx->nl_points] = mousex_snap; + xctx->nl_polyy[xctx->nl_points] = mousey_snap; } else { return; } @@ -3456,16 +3456,16 @@ void new_polygon(int what, double mousex_snap, double mousey_snap) } if(what & RUBBER) { - if(xctx->mousex_snap < xctx->nl_x1) xctx->nl_x1 = xctx->mousex_snap; - if(xctx->mousex_snap > xctx->nl_x2) xctx->nl_x2 = xctx->mousex_snap; - if(xctx->mousey_snap < xctx->nl_y1) xctx->nl_y1 = xctx->mousey_snap; - if(xctx->mousey_snap > xctx->nl_y2) xctx->nl_y2 = xctx->mousey_snap; + if(mousex_snap < xctx->nl_x1) xctx->nl_x1 = mousex_snap; + if(mousex_snap > xctx->nl_x2) xctx->nl_x2 = mousex_snap; + if(mousey_snap < xctx->nl_y1) xctx->nl_y1 = mousey_snap; + if(mousey_snap > xctx->nl_y2) xctx->nl_y2 = mousey_snap; /* fprintf(errfp, "new_poly: RUBBER\n"); */ drawtemppolygon(xctx->gctiled, NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points+1, 0); - xctx->nl_polyy[xctx->nl_points] = xctx->mousey_snap; - xctx->nl_polyx[xctx->nl_points] = xctx->mousex_snap; + xctx->nl_polyy[xctx->nl_points] = mousey_snap; + xctx->nl_polyx[xctx->nl_points] = mousex_snap; restore_selection(xctx->nl_x1, xctx->nl_y1, xctx->nl_x2, xctx->nl_y2); - /* xctx->nl_x2 = xctx->mousex_snap; xctx->nl_y2 = xctx->mousey_snap; */ + /* xctx->nl_x2 = mousex_snap; xctx->nl_y2 = mousey_snap; */ drawtemppolygon(xctx->gc[xctx->rectcolor], NOW, xctx->nl_polyx, xctx->nl_polyy, xctx->nl_points+1, 0); } } diff --git a/src/scheduler.c b/src/scheduler.c index 6735dba9..a40c3ad6 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -2133,6 +2133,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg my_snprintf(res, S(res), "color_ps=%d\n", color_ps); Tcl_AppendResult(interp, res, NULL); my_snprintf(res, S(res), "hilight_nets=%d\n", xctx->hilight_nets); Tcl_AppendResult(interp, res, NULL); my_snprintf(res, S(res), "semaphore=%d\n", xctx->semaphore); Tcl_AppendResult(interp, res, NULL); + my_snprintf(res, S(res), "constr_mv=%d\n", xctx->constr_mv); Tcl_AppendResult(interp, res, NULL); my_snprintf(res, S(res), "ui_state=%d\n", xctx->ui_state); Tcl_AppendResult(interp, res, NULL); my_snprintf(res, S(res), "ui_state2=%d\n", xctx->ui_state2); Tcl_AppendResult(interp, res, NULL); my_snprintf(res, S(res), "drag_elements=%d\n", xctx->drag_elements); Tcl_AppendResult(interp, res, NULL); @@ -2244,7 +2245,6 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg } } - /* help * Print command help */ else if(!strcmp(argv[1], "help"))