better threshold for selecting rectangle vertices
This commit is contained in:
parent
4a418924eb
commit
73ab9de8da
|
|
@ -1347,19 +1347,19 @@ static int edit_rect_point(int state)
|
|||
xRect *p = &xctx->rect[rect_c][rect_n];
|
||||
|
||||
xctx->need_reb_sel_arr=1;
|
||||
if(POINTINSIDE(xctx->mousex, xctx->mousey, p->x1, p->y1, p->x1 + ds, p->y1 + ds)) {
|
||||
if(POINTINSIDE(xctx->mousex_snap, xctx->mousey_snap, p->x1, p->y1, p->x1 + ds, p->y1 + ds)) {
|
||||
xctx->shape_point_selected = 1;
|
||||
p->sel = SELECTED1;
|
||||
}
|
||||
else if(POINTINSIDE(xctx->mousex, xctx->mousey, p->x2 - ds, p->y1, p->x2, p->y1 + ds)) {
|
||||
else if(POINTINSIDE(xctx->mousex_snap, xctx->mousey_snap, p->x2 - ds, p->y1, p->x2, p->y1 + ds)) {
|
||||
xctx->shape_point_selected = 1;
|
||||
p->sel = SELECTED2;
|
||||
}
|
||||
else if(POINTINSIDE(xctx->mousex, xctx->mousey, p->x1, p->y2 - ds, p->x1 + ds, p->y2)) {
|
||||
else if(POINTINSIDE(xctx->mousex_snap, xctx->mousey_snap, p->x1, p->y2 - ds, p->x1 + ds, p->y2)) {
|
||||
xctx->shape_point_selected = 1;
|
||||
p->sel = SELECTED3;
|
||||
}
|
||||
else if(POINTINSIDE(xctx->mousex, xctx->mousey, p->x2 - ds, p->y2 - ds, p->x2, p->y2)) {
|
||||
else if(POINTINSIDE(xctx->mousex_snap, xctx->mousey_snap, p->x2 - ds, p->y2 - ds, p->x2, p->y2)) {
|
||||
xctx->shape_point_selected = 1;
|
||||
p->sel = SELECTED4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,13 +289,16 @@ static void find_closest_arc(double mx,double my)
|
|||
static void find_closest_box(double mx,double my, int override_lock)
|
||||
{
|
||||
double tmp;
|
||||
double ds = xctx->cadhalfdotsize;
|
||||
|
||||
int i,c,r=-1, col = 0;
|
||||
for(c=0;c<cadlayers; ++c)
|
||||
{
|
||||
if(!xctx->enable_layer[c]) continue;
|
||||
for(i=0;i<xctx->rects[c]; ++i)
|
||||
{
|
||||
if( POINTINSIDE(mx,my,xctx->rect[c][i].x1,xctx->rect[c][i].y1,xctx->rect[c][i].x2,xctx->rect[c][i].y2) )
|
||||
if( POINTINSIDE(mx,my,xctx->rect[c][i].x1 - ds, xctx->rect[c][i].y1 - ds,
|
||||
xctx->rect[c][i].x2 + ds, xctx->rect[c][i].y2 + ds) )
|
||||
{
|
||||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue