find_closest_box(): allow selection of rectangles if clicking close (close-in or close-out) to the rectangle border.

This commit is contained in:
stefan schippers 2025-09-19 23:11:24 +02:00
parent 318323267c
commit 4428c2ab67
1 changed files with 6 additions and 1 deletions

View File

@ -391,7 +391,12 @@ static void find_closest_box(double mx ,double my, int override_lock)
for(i=0;i<xctx->rects[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);