Added wire-coordinate ordering before storing the object in 'src/move.c' -> 'move_objects()' to remove any discrepancies (addresses issues mentioned in #336).

This commit is contained in:
Chayan Deb 2025-03-17 12:55:28 +05:30
parent 2256c8d329
commit d430ce9867
1 changed files with 3 additions and 0 deletions

View File

@ -1147,6 +1147,7 @@ void move_objects(int what, int merge, double dx, double dy)
{
wire[n].x2 = xctx->rx2;
wire[n].y2 = xctx->ry1;
ORDER(xctx->rx2,xctx->ry1,xctx->rx2,xctx->ry2);
storeobject(-1, xctx->rx2,xctx->ry1,xctx->rx2,xctx->ry2,WIRE,0,0,NULL);
hash_wire(XINSERT, xctx->wires-1, 1);
drawline(WIRELAYER,ADD, xctx->rx2,xctx->ry1,xctx->rx2,xctx->ry2, 0, NULL);
@ -1155,12 +1156,14 @@ void move_objects(int what, int merge, double dx, double dy)
{
wire[n].x2 = xctx->rx1;
wire[n].y2 = xctx->ry2;
ORDER(xctx->rx1,xctx->ry2,xctx->rx2,xctx->ry2);
storeobject(-1, xctx->rx1,xctx->ry2,xctx->rx2,xctx->ry2,WIRE,0,0,NULL);
hash_wire(XINSERT, xctx->wires-1, 1);
drawline(WIRELAYER,ADD, xctx->rx1,xctx->ry2,xctx->rx2,xctx->ry2, 0, NULL);
}
else
{
/* no need for ordering coordinates - already done before */
wire[n].x2 = xctx->rx2;
wire[n].y2 = xctx->ry2;
}