Return the two or three points needed to route from p1 to p2.
(p1: QPointF, p2: QPointF, h_first: bool)
| 71 | |
| 72 | |
| 73 | def _elbow(p1: QPointF, p2: QPointF, h_first: bool) -> list[QPointF]: |
| 74 | """Return the two or three points needed to route from p1 to p2.""" |
| 75 | dx = abs(p1.x() - p2.x()) |
| 76 | dy = abs(p1.y() - p2.y()) |
| 77 | if dx < 0.1 or dy < 0.1: # already aligned |
| 78 | return [p1, p2] |
| 79 | mid = QPointF(p2.x(), p1.y()) if h_first else QPointF(p1.x(), p2.y()) |
| 80 | return [p1, mid, p2] |
| 81 | |
| 82 | |
| 83 | # ── junction detection ──────────────────────────────────────────────────────── |
no outgoing calls
no test coverage detected