Index: trunk/src/libgrbs/route_remove.c =================================================================== --- trunk/src/libgrbs/route_remove.c (revision 1311) +++ trunk/src/libgrbs/route_remove.c (revision 1312) @@ -36,7 +36,7 @@ /* if there is anything above the new arc, shrink radius pushing the above-arcs lower (by exactly as much as twonet tn took) */ -static double shrink_seg_radii_any(grbs_t *grbs, grbs_arc_t *arc, int *need_narc_post_update, double *narc_oldr_out, int is_concave) +static grbs_arc_t *shrink_seg_radii_any(grbs_t *grbs, grbs_arc_t *arc, int *need_narc_post_update, double *narc_oldr_out, int is_concave) { grbs_arc_t *next, *prev; double prev_copper, prev_clearance, newr, incr, prevr; @@ -61,7 +61,7 @@ next = grbs_next_arc_in_use(arc); if (next == NULL) { *narc_oldr_out = 0; - return narcr; + return NULL; } narcr = next->r; @@ -91,7 +91,7 @@ bump_seg_radii(grbs, next, incr); *narc_oldr_out = narc_oldr; - return narcr; + return next; } @@ -110,9 +110,9 @@ void grbs_path_remove_arc(grbs_t *grbs, grbs_arc_t *arc) { - grbs_arc_t *narc, *a, *first; + grbs_arc_t *narc, *a, *first, *sarc, *sentinel; int rev = 1, need_narc_post_update = 0; - double narcr, narc_oldr; + double narc_oldr; grbs_point_t *pt; int is_concave = arc->concave; @@ -122,15 +122,20 @@ } pt = arc->parent_pt; - first = gdl_first(&pt->arcs[is_concave][arc->segi]); + first = sentinel = gdl_first(&pt->arcs[is_concave][arc->segi]); + if (!first->new_in_use) + first = gdl_next(&pt->arcs[is_concave][arc->segi], first); /* for already realized arcs: first is the first above sentinel */ /* make room for the new arc */ - narcr = shrink_seg_radii_any(grbs, arc, &need_narc_post_update, &narc_oldr, is_concave); + sarc = shrink_seg_radii_any(grbs, arc, &need_narc_post_update, &narc_oldr, is_concave); + if (arc == first) { + if (sarc != NULL) + update_seg_sentinel_angles(sentinel, sarc); + else { +#warning TODO: remove sentinel + } + } -#warning TODO: when lowest removed -/* if (arc == first) - update_seg_sentinel_angles(first, narc);*/ - #warning TODO #if 0 /* if we removed a convex, we need to bump any concave above it as well */