From ae3c7bb11f2c7a05e231667d0aa9e13012536b03 Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 9 Dec 2023 12:31:55 -0800 Subject: [PATCH] Better corner-picking for connections --- src/porporo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/porporo.c b/src/porporo.c index 59bceda..802bc8a 100644 --- a/src/porporo.c +++ b/src/porporo.c @@ -105,7 +105,9 @@ drawconnections(Varvara *a, Uint32 color) Varvara *b = a->routes[i]; if(b && b->live) { x1 = a->x + 1 + camera.x + a->screen.w, y1 = a->y - 2 + camera.y; - x2 = b->x - 2 + camera.x, y2 = b->y - 2 + camera.y; + x2 = b->x - 2 + camera.x, y2 = b->y + b->screen.h + 1 + camera.y; + if(a->y < b->y) + y1 = a->y + a->screen.h + 1 + camera.y, y2 = b->y - 2 + camera.y; drawline(x1, y1, x2, y2, color); } }