From a681a26c89287e4403b72f7a1cb8053e2c0bcdc1 Mon Sep 17 00:00:00 2001 From: idatui Date: Sun, 9 Aug 2026 12:59:38 +0200 Subject: graph_triskel: name the detour target, drop the unused swap --- idatui/graph_triskel.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/idatui/graph_triskel.py b/idatui/graph_triskel.py index e5b662e..343e6f5 100644 --- a/idatui/graph_triskel.py +++ b/idatui/graph_triskel.py @@ -300,16 +300,16 @@ def _repair_boxes(g: G._Graph, routes: list[G.Route]) -> int: n = hit[0] if p[1] == q[1]: # vertical: shift column col = p[1] - near, far = n.x - 1, n.right + 1 - if col - n.x > n.right - col or near < 0: - near, far = far, near # never detour off-canvas - p, q = (p[0], near), (q[0], near) + out = n.x - 1 # nearest side of the box + if col - n.x > n.right - col or out < 0: + out = n.right + 1 # never detour off-canvas + p, q = (p[0], out), (q[0], out) else: # horizontal: shift row row = p[0] - near, far = n.y - 1, n.bottom + 1 - if row - n.y > n.bottom - row or near < 0: - near, far = far, near - p, q = (near, p[1]), (near, q[1]) + out = n.y - 1 + if row - n.y > n.bottom - row or out < 0: + out = n.bottom + 1 + p, q = (out, p[1]), (out, q[1]) rt.pts[i], rt.pts[i + 1] = p, q moved += 1 return moved -- cgit v1.3.1-sl0p