Index: src_plugins/rbs_routing/map.c =================================================================== --- src_plugins/rbs_routing/map.c (revision 38849) +++ src_plugins/rbs_routing/map.c (revision 38850) @@ -194,7 +194,7 @@ #define FIND_PT_DELTA 2 #define FIND_PT_DELTA2 RBSR_R2G(FIND_PT_DELTA * FIND_PT_DELTA) -RND_INLINE grbs_point_t *rbsr_find_point_(rbsr_map_t *rbs, rnd_coord_t cx_, rnd_coord_t cy_, double bestd2) +RND_INLINE grbs_point_t *rbsr_find_point_(rbsr_map_t *rbs, rnd_coord_t cx_, rnd_coord_t cy_, double bestd2, double delta) { double cx = RBSR_R2G(cx_), cy = RBSR_R2G(cy_); grbs_point_t *pt, *best = NULL; @@ -201,10 +201,10 @@ grbs_rtree_it_t it; grbs_rtree_box_t bbox; - bbox.x1 = cx - FIND_PT_DELTA; - bbox.y1 = cy - FIND_PT_DELTA; - bbox.x2 = cx + FIND_PT_DELTA; - bbox.y2 = cy + FIND_PT_DELTA; + bbox.x1 = cx - delta; + bbox.y1 = cy - delta; + bbox.x2 = cx + delta; + bbox.y2 = cy + delta; for(pt = grbs_rtree_first(&it, &rbs->grbs.point_tree, &bbox); pt != NULL; pt = grbs_rtree_next(&it)) { double dx = cx - pt->x, dy = cy - pt->y, d2 = dx*dx + dy*dy; @@ -219,14 +219,19 @@ grbs_point_t *rbsr_find_point_by_center(rbsr_map_t *rbs, rnd_coord_t cx, rnd_coord_t cy) { - return rbsr_find_point_(rbs, cx, cy, FIND_PT_DELTA2+1); + return rbsr_find_point_(rbs, cx, cy, FIND_PT_DELTA2+1, FIND_PT_DELTA); } grbs_point_t *rbsr_find_point(rbsr_map_t *rbs, rnd_coord_t cx, rnd_coord_t cy) { - return rbsr_find_point_(rbs, cx, cy, RND_COORD_MAX); + return rbsr_find_point_(rbs, cx, cy, RND_COORD_MAX, FIND_PT_DELTA); } +grbs_point_t *rbsr_find_point_thick(rbsr_map_t *rbs, rnd_coord_t cx, rnd_coord_t cy, rnd_coord_t delta) +{ + return rbsr_find_point_(rbs, cx, cy, RND_COORD_MAX, delta); +} + /* whether two coords are matching within 10 nm */ #define CRDEQ_DELTA RBSR_R2G(10) RND_INLINE int crdeq(double c1, double c2) Index: src_plugins/rbs_routing/map.h =================================================================== --- src_plugins/rbs_routing/map.h (revision 38849) +++ src_plugins/rbs_routing/map.h (revision 38850) @@ -49,3 +49,5 @@ /* Return the point that is close enough to cx;cy or NULL if nothing is close */ grbs_point_t *rbsr_find_point(rbsr_map_t *rbs, rnd_coord_t cx, rnd_coord_t cy); +/* Same as rbsr_find_point but searches with a bigger box (of width 2*delta) */ +grbs_point_t *rbsr_find_point_thick(rbsr_map_t *rbs, rnd_coord_t cx, rnd_coord_t cy, rnd_coord_t delta); Index: src_plugins/rbs_routing/seq.c =================================================================== --- src_plugins/rbs_routing/seq.c (revision 38849) +++ src_plugins/rbs_routing/seq.c (revision 38850) @@ -159,7 +159,7 @@ double l1x, l1y, l2x, l2y, px, py, side, dist2, dx, dy, cop2; grbs_arc_dir_t dir; - end = rbsr_find_point(&rbsq->map, tx, ty); + end = rbsr_find_point_thick(&rbsq->map, tx, ty, RBSR_R2G((double)rnd_pixel_slop*10.0)); if (end == NULL) { int need_redraw = 0; if (rbsq->consider.dir != RBS_ADIR_invalid)