diff options
| author | idatui <user@clank> | 2026-08-09 12:59:38 +0200 |
|---|---|---|
| committer | idatui <user@clank> | 2026-08-09 12:59:38 +0200 |
| commit | a681a26c89287e4403b72f7a1cb8053e2c0bcdc1 (patch) | |
| tree | 145b9666e8f3429f40119852c299cfabcd70d03a /idatui | |
| parent | Graph: a second layout engine, triskel's SESE decomposition (diff) | |
| download | ida-tui-a681a26c89287e4403b72f7a1cb8053e2c0bcdc1.tar.gz ida-tui-a681a26c89287e4403b72f7a1cb8053e2c0bcdc1.tar.xz ida-tui-a681a26c89287e4403b72f7a1cb8053e2c0bcdc1.zip | |
graph_triskel: name the detour target, drop the unused swap
Diffstat (limited to 'idatui')
| -rw-r--r-- | idatui/graph_triskel.py | 16 |
1 files 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 |
