From 4428c2ab67d03fd96f9402db87280a3f2f8709b0 Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Fri, 19 Sep 2025 23:11:24 +0200 Subject: [PATCH] find_closest_box(): allow selection of rectangles if clicking close (close-in or close-out) to the rectangle border. --- src/findnet.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/findnet.c b/src/findnet.c index 4621588f..0c9ff819 100644 --- a/src/findnet.c +++ b/src/findnet.c @@ -391,7 +391,12 @@ static void find_closest_box(double mx ,double my, int override_lock) for(i=0;irects[c]; ++i) { if( POINTINSIDE(mx, my, xctx->rect[c][i].x1 - threshold, xctx->rect[c][i].y1 - threshold, - xctx->rect[c][i].x2 + threshold, xctx->rect[c][i].y2 + threshold) ) + xctx->rect[c][i].x2 + threshold, xctx->rect[c][i].y2 + threshold) && + !POINTINSIDE(mx, my, xctx->rect[c][i].x1 + threshold, xctx->rect[c][i].y1 + threshold, + xctx->rect[c][i].x2 - threshold, xctx->rect[c][i].y2 - threshold)) + + + { tmp=dist_from_rect(mx, my, xctx->rect[c][i].x1, xctx->rect[c][i].y1, xctx->rect[c][i].x2, xctx->rect[c][i].y2);