find_closest_box(): allow selection of rectangles if clicking close (close-in or close-out) to the rectangle border.
This commit is contained in:
parent
318323267c
commit
4428c2ab67
|
|
@ -391,7 +391,12 @@ static void find_closest_box(double mx ,double my, int override_lock)
|
||||||
for(i=0;i<xctx->rects[c]; ++i)
|
for(i=0;i<xctx->rects[c]; ++i)
|
||||||
{
|
{
|
||||||
if( POINTINSIDE(mx, my, xctx->rect[c][i].x1 - threshold, xctx->rect[c][i].y1 - threshold,
|
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,
|
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);
|
xctx->rect[c][i].x2, xctx->rect[c][i].y2);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue